Package net.jrodolfo.java_evolution.java14
package net.jrodolfo.java_evolution.java14
Examples for features introduced in Java 14.
Java 14 finalized switch expressions and introduced helpful
NullPointerException messages. It also previewed records and pattern
matching for instanceof, both of which became final in Java 16.
For beginner-oriented notes about the problems these features solved, see the package README in the source directory.
-
ClassDescriptionDemonstrates helpful
NullPointerExceptionmessages, introduced in Java 14.Address with a city value used by the null-pointer diagnostic example.Customer with an address reference used to trigger nested null access.Demonstrates pattern matching forinstanceofas a Java 14 preview feature.Demonstrates records as a Java 14 preview feature.Compact data carrier used to demonstrate record syntax.Demonstrates switch expressions, finalized in Java 14.