Java Features (Java 8 → Java 25)
Java 8 (2014)
- Lambdas & functional interfaces (
java.util.function)
- Streams API
- Default & static methods in interfaces
Optional class
- New Date & Time API (
java.time)
- Repeating annotations
- Type annotations
Java 9
- Java Platform Module System (JPMS)
- JShell (REPL)
- Improved Process API (
ProcessHandle)
- New HTTP/2 Client (
java.net.http)
- Collection factory methods (
List.of, Set.of, etc.)
- Stream API enhancements (
takeWhile, dropWhile, ofNullable)
- Multi-release JARs
Java 10
- Local variable type inference (
var)
- GC & performance improvements (G1 enhancements)
Java 11 (LTS)
- Standardized HTTP Client (HTTP/1.1, HTTP/2, WebSocket)
- New String methods (
isBlank, lines, strip, etc.)
Collection.toArray(IntFunction<T[]>)
- Nest-based access control
- Dynamic class-file constants (
CONSTANT_Dynamic)
- Epsilon GC (no-op garbage collector)
Java 12 → 16
- Switch expressions (
switch as an expression)
- Text blocks (multi-line strings)
- Pattern matching for
instanceof
- Records (data classes)
- Sealed classes (restricted inheritance)
- Foreign Function & Memory API (incubator)
- Vector API (incubator)
Java 17 (LTS, 2021)
- Sealed classes (finalized)
- Strong encapsulation of JDK internals
- macOS Metal rendering pipeline
- Foreign Function & Memory API (incubator)
- Vector API (incubator)
- Contextual deserialization filters
Java 21 (LTS, 2023)
- Virtual Threads (Project Loom)
- Pattern matching for
switch
- Record patterns
- Sequenced Collections (ordered/reversible)
- Ongoing preview & incubator features (Panama, Valhalla, etc.)
- Improvements in pattern matching & FFM API
Java 25 (Upcoming LTS, 2025)
- Compact Source Files & Instance Main Methods (JEP 512)
- Flexible Constructor Bodies
- Scoped Values (JEP 506, finalized)
- Primitive Types in Patterns (JEP 507, preview)
- JFR Enhancements (CPU profiling, cooperative sampling, tracing)
- Generational Shenandoah GC (JEP 521)
- Key Derivation Function (KDF) API (JEP 510)
- Module Import Declarations (JEP 511)
- Compact Object Headers (JEP 519)
- Removal of 32-bit x86 port