Introduction of New Generation Java Programming Guide (Java 11)

This article is a continuation of Introduction to the New Generation Java Programming Guide (Java 10).

Changes in Java 11

In Java 11, the following 6 are written.

Local variable syntax for lambda parameters

You can now use var with Lambda expression parameters in Java 11. Some may wonder, "Oh? The parameters of a Lambda expression didn't have to have a type declaration originally?" Certainly in a Lambda expression

(int age) -> x > 100;
(age) -> x > 100;
x -> x > 100;

You can write something like this, and the type specification is omitted except for the first one. And the fact that var can be used as a parameter

(var age) -> x > 100;

It means that you can write like this. By the way, when using var

var age -> x > 100;

You cannot omit () as in. There is no advantage to using var in the previous example, but using var allows you to add * annotations without * type declaration. In other words

@Nullable var name -> name.length() > 32;

It means that you can write something like this. If you couldn't use var, you couldn't use annotations without a concrete type declaration. The book explains these stories in detail.

Epsilon GC-improved garbage collector

Epsilon GC is a "garbage-collect-free GC". It sounds like a contradiction, but Epsilon GC frees up memory, so if your application runs out of heap memory, the JVM will exit with the familiar ʻOutOfMemoryError`. This is the Epsilon GC, but there are some useful situations.

HTTP client API

It details the HTTP client API, which appeared as a non-standard library in Java 9, has been modified in Java 10 and standardized in Java 11. Java has had an HttpURLConnection class since the 1.1 era, but from the explanation of why the development of a new HTTP library was made, the method list of each class, and the sample of concrete code examples, from the basic contents to concrete It is explained in considerable detail. I think the content is easy to understand even for developers who do not usually develop using HTTP clients.

ZGC-Lower latency and improved scalability

This is a description of ZGC (Z Garbage Collector) released as an experimental GC for Java 11. It explains the features of ZGC that promises that the application delay does not exceed 10 mm, how it works, command examples and options for actually using ZGC.

Flight recorder and mission control

Use the JFR (Java Flight Recorder), which is a high-performance, low-overhead profiler built into the JVM, and the JMC (Java Mission Control), which is a tool for analyzing data recorded by JFF, as a tutorial. It is explained using an example. This knowledge will be useful for investigating the cause when the application is crashing or behaving unexpectedly.

Other improvements to JDK 11

Other improvements are described in the following items.

All of them are just brief explanations, but you should be aware of some useful features (especially if you don't use an IDE), such as programming a single file source code.

This is the introduction of the new generation Java programming guide (Java 11).

Recommended Posts

Introduction of New Generation Java Programming Guide (Java 10)
Introduction of New Generation Java Programming Guide (Java 11)
Introduction of New Generation Java Programming Guide (Java 12)
Introduction of the new generation Java programming guide (Java language extension project "Amber" edition)
[Java] New Thread generation method (2)
[Java] New Thread generation method (1)
Introduction to Functional Programming (Java, Javascript)
Summary of object-oriented programming using Java
[Java] Introduction
Memorandum of new graduate SES [Java basics]
Java Programming Style Guide for the Java 11 Era
Output of the book "Introduction to Java"
I wrote EX25 of AtCoder Programming Guide for beginners (APG4b) in java.
Introduction of pay.jp
The story of learning Java in the first programming
Introduction of milkode
JAVA: Realizes generation and scanning of various barcodes
Java permutation generation
Memorandum of new graduate SES [Java object-oriented edition]
java1.8 new features
java Generic Programming
[Java] Introduction to Java
I touched on the new features of Java 15
Introduction to java
[Introduction to Java] Basics of java arithmetic (for beginners)
Let's use Java New FileIO! (Introduction, for beginners)
[Java] Overview of Java
Introduction and introduction of management screen generation gem Administrate
Experience of passing Java Silver as a new graduate
Introduction to Java for beginners Basic knowledge of Java language â‘ 
Quick learning Java "Introduction?" Part 3 Talking away from programming
Predicted Features of Java
Java 12 new feature summary
Constraint programming in Java
[Java] Significance of serialVersionUID
Introduction of Docker --Part 1--
Review of java Shilber
Java 13 new feature summary
[Java] Stream API-Stream generation
[Rails] Introduction of PAY.JP
java --Unification of comments
Java programming basics practice-array
History of Java annotation
java (merits of polymorphism)
Java programming (class method)
Introduction to Practical Programming
[Java] Password generation (Pasay)
Introduction of user authentication
NIO review of java
Introduction to java command
Java programming (class structure)
All about Java programming
Java 10 new feature summary
java competitive programming memo
[Java] Three features of Java
Java 14 new feature summary
What's new in Java 9,10,11
Summary of Java support 2018
Java Programming Thread Runnable
Reintroduction to Java for Humanities 0: Understanding the Act of Programming
[Introduction to Java] Handling of character strings (String class, StringBuilder class)