This article is a continuation of Introduction to the New Generation Java Programming Guide (Java 10).
In Java 11, the following 6 are written.
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 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.
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.
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.
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 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