Java 7 Features:
- Usage of Strings in Switch Statement
- Diamond Operator – the diamond operator allows you to write more compact (and readable) code by saving repeated type arguments
- Try with Resources
- Multiple Exception Handling
- Suppressed Exceptions
- Allows Binay Literals – Binary Literal are expressing Integer Values in terms of Binary Value by adding the prefix 0b or 0B to the integral value.For more on BinayLiteral click here
Java 8 Features:
- Lambda Expressions
- Java Stream API for Bulk Data Operations on Collections.
- Static and Default method in Functional Interfaces
- forEach() method in Iterable interface
- Functional Interfaces
- Collection API improvements
Java 9 Features:
- Factory Methods for Immutable List, Set, Map and Map.Entry
- Private methods in Interfaces
- Reactive Streams
- JShell: the interactive Java REPL
Java 10 Features:
- Local-Variable Type Inference
- Application Class-Data Sharing
- default set of root Certification Authority (CA) certificates in the JDK
- Garbage Collector Interface
Java 11 Features:
- Java 11 JDK is not free for usage on commercial purpose
- No need to compile.typing >>Java in command prompt will compile and run java
- Remove the Java EE and CORBA Modules –
- Java String Methods – isBlank(), lines(), strip(), stripLeading(), stripTrailing()
Java 17 Features:
- LTS support and licenses Java 17 LTS is the latest long-term support release for the Java SE platform
- Pattern matching for the switch case
- Sealed classes and interfaces. Sealed classes and interfaces restrict which other classes or interfaces may extend or implement them.
sealed class Human permits Manish, Vartika, Anjali { public void printName() { System.out.println("Default"); } } non-sealed class Manish extends Human { public void printName() { System.out.println("Manish Sharma"); } }