Posts

Showing posts from August, 2020

Useful Java Language Features : Version 11 to 14

For product releases after Java SE 8, Oracle would designate a release, every three years, as a Long-Term-Support (LTS) release. Java SE 11 is an LTS release.  Based on the Oracle Java SE Support Roadmap, Java SE 12 to 15 are non-LTS releases that are more about incremental updates rather than major ones.  At the time of writing, the latest stable Java SE release is version 14.  This release is non-LTS. While the Open JDK community project has their latest release, version 14, available for download,  Amazon offers their latest Corretto JDK, version 11, also for free.  There are other JDK providers offering version 11 and/or 14 as well. Here are some examples to help understanding some of the language features from Java 11 to 14. Java 11: var declaration in Lambda expression // Java 11: var declaration in lambda expression UnaryOperator<Integer> square = (@NonNull var x) -> x * x; // var can be used with annotation such as @NonNull System.out.printl...