After Java8, Java9 has big changes & new features. Here in this section we will talk about Java Features After Java9. We will update this section on a regular basis on a release of new version. Let’s see Java Features After Java9.
Table of Contents (Click on links below to navigate)
New In Java 10
1. Local Variable Type Inference : var x=10; allowed but var is not a keyword
var s =null is not allowed.
var can’t be defined at class level, can’t be assigned to Lambda expression but can be defined inside lambda expression.
2. Collectors has new method Collectors.unmodifiableList() to control list from modification. Similarly for Set & Map as well.
3. Garbage collector changes.
4. Some methods deprecated.
New In Java 11
Note that from Java 11 Oracle has updated the license term to use only for developing, testing, prototyping, demonstrate your application. You may not use the programs for data processing or any commercial, production or any internal business purposes.
Subscription plan was already in place on yearly or one time payment basis but they have given option of monthly subscription now.
In summary Java is free for personal & non-commercial use always.
Added Features:
1. Collection.toArray(IntFunction) default method
2. Local-variable syntax for Lambda Parameters
Removed features :
1. Com.sun.awt.AWTUtilities class : it was deprecated since jdk8
2. appletViewer Launcher
3. Thread.destroy() & Thread.stop(Throwable)
4. Java EE & CORBA modules
New In Java 12
1. Switch-case Statement : multiple entries allowed as case input
2. String literal : HTML code can also be included without any \n character.
3. Other Garbage Collector & Performance Improvements
New In Java 13
1. Yield keyword in Switch-case Statement : If we use colon (:) operator, we need to use yield keyword as shown in below code snippet.
2. Text block : will be printed exactly as it is written: introduced with triple quote “”” . Now JSON format code can also be inserted without any special character.
New In Java 14
Please visit Java 14 Features
New In Java 15
Please visit Java 15 Features