Introduction of New Generation Java Programming Guide (Java 12)

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

Changes in Java 12

Java 12 describes two things:

switch expression

Switch statements are not a formal feature of Java 12. On the contrary, Java 13 is not official and is a formal feature from Java 14. The book explains that you should specify the --enable-preview option at compile time or run time as a way to use the preview function, but Java 14 has also been released now, so if you use Java 14, there is no option. You can do it. To be honest, I haven't used switch so much until now, but I think that using this switch expression will increase the number of cases where you can write completely safe code. The book explains in an easy-to-understand manner what was the problem with the switch so far and how it was improved with the switch expression, along with sample code.

Other improvements in JDK 12

Other improvements are described in the following items.

As with all the examples, only a brief explanation is given, but in such a situation, the "default CDS archive" is a little more explanation. Moreover, even though CDS is explained in detail in Java 10 "AppCDS Application Class Data Sharing". Perhaps this is because the author wants you to use this feature. I don't know what I mean, but I felt that way. I also felt that the GC was constantly being improved.

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

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
java programming basics
Introduction of milkode
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
[Introduction to Java] List of things that got caught by the 14th day of programming
Summary of revisions (new era) support by Java version
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
Java Performance Chapter 1 Introduction
Expired collection of java
Predicted Features of Java
Java 12 new feature summary
Constraint programming in Java
[Java] Significance of serialVersionUID
Introduction of Docker --Part 1--
NIO.2 review of java
Review of java Shilber
Java 13 new feature summary
[Java] Stream API-Stream generation
[Rails] Introduction of PAY.JP
java --Unification of comments
History of Java annotation
java (merits of polymorphism)
Java programming (class method)
Introduction to Practical Programming
[Java] Password generation (Pasay)
Introduction of user authentication
What's new in Java 8
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
What's new in Java 9,10,11
Summary of Java support 2018