Java new features 8,9,10,11,12,13,14,15,16,17,18,19,20,21
Summary of #Java 8,9,10,11,12,13,14,15,16,17,18,19,20,21 features. All features in a single post.
#Java 21 Features:
- Record Patterns
- Pattern Matching for switch
- String Templates (Preview)
- Unnamed Patterns and Variables (Preview)
- Unnamed Classes and Instance Main Methods (Preview)
- Virtual Threads
- Sequenced Collections
- Key Encapsulation Mechanism API
- Foreign Function & Memory API (Third Preview)
- Structured Concurrency (Preview)
- Scoped Values (Preview)
- Vector API (Sixth Incubator)
- Generational ZGC
- Prepare to Disallow the Dynamic Loading of Agents
- Runtime.exec
and ProcessBuilder
Logging of Command Arguments
- System.exit()
and Runtime.exit()
Logging
- Math.clamp()
and StrictMath.clamp()
Methods
- New String
indexOf(int,int,int)
add indexOf(String,int,int)
- Unicode Emoji Properties
- New splitWithDelimiters()
Methods Added to String
and java.util.regex.Pattern
#Java 20 Features:
- Record Patterns (Second Preview)
- Pattern Matching for switch (Fourth Preview)
- Foreign Function & Memory API (Second Preview)
- Vector API (Fifth Incubator)
- Scoped Values (Incubator)
- Virtual Threads (Second Preview)
- Structured Concurrency (Second Incubator)
- Support Unicode 15.0
- New JFR Event: jdk.InitialSecurityProperty
- Javac Warns about Type Casts in Compound Assignments with Possible Lossy Conversions
- New ‘jmod — compress’ Command Line Option
- Print Warning to Standard Error If Bad java.io.tmpdir Setting Is Detected
#Java 19 Features:
- Virtual Threads (Preview)
- Structured Concurrency (Incubator)
- Record Patterns (Preview)
- Pattern Matching for switch (Third Preview)
- Foreign Function & Memory API (Preview)
- Vector API (Fourth Incubator)
- Support Unicode 14.0
- New system properties for System.out
and System.err
- Additional Date-Time Formats
- New Methods to Create Preallocated HashMaps and HashSets
- Windows KeyStore Updated to Include Access to the Local Machine Location
#Java 18 Features:
- UTF-8 by Default
- Simple Web Server
- Code Snippets in Java API Doc
- Reimplement Core Reflection with Method Handles
- Vector API
- Internet-Address Resolution SPI
- Foreign Function & Memory API
- Pattern Matching for switch
#Java 17 Features:
- Restore Always-Strict Floating-Point Semantics
- Enhanced Pseudo-Random Number Generators
- New macOS Rendering Pipeline
- macOS/AArch64 Port
- Deprecate the Applet API for Removal
- Strongly Encapsulate JDK Internals
- Pattern Matching for switch
#Java 16 Features:
- Vector API
- Enable C++14 Language Features
- Migrate from Mercurial to Git
- Migrate to GitHub
- Concurrent Thread-Stack Processing
- Unix-Domain Socket Channels
- Alpine Linux Port
- Elastic Metaspace
- Windows/AArch64 Port
#Java 15 Features
- Sealed Classes and Interfaces
- EdDSA Algorithm
- Hidden Classes
- Pattern Matching for instanceof
- Removed Nashorn JavaScript Engine
- Reimplement the Legacy DatagramSocket API
- Records (Second Preview)
- Text Blocks become a standard feature
#Java 14 Features
– Pattern Matching for instanceof
– Text Blocks
– Helpful NullPointerExceptions
– Records
– Switch Expressions
– Packaging Tool
– NUMA-Aware Memory Allocation for G1
– JFR Event Streaming
– Non-Volatile Mapped Byte Buffers
– Remove the Pack200 Tools and API
#Java 13 Features:
– Text Blocks (Preview)
– Switch Expressions Enhancements (Preview)
– Reimplement the Legacy Socket API
– Dynamic CDS Archive
– ZGC: Uncommit Unused Memory
– FileSystems.newFileSystem() Method
– DOM and SAX Factories with Namespace Support
# Java 12 Features:
- Collectors.teeing() in Stream API
- String API Changes
- Files.mismatch(Path, Path)
- Compact Number Formatting
- Support for Unicode 11
- Switch Expressions (Preview)
#Java 11 Features:
- HTTP Client API
- Launch Single-File Programs Without Compilation
- String API Changes
- Collection.toArray(IntFunction)
- Files.readString() and Files.writeString()
- Optional.isEmpty()
#Java 10 Features:
- Local Variable Type Inference
- Time-Based Release Versioning
- Garbage-Collector Interface
- Parallel Full GC for G1
- Heap Allocation on Alternative Memory Devices
- Consolidate the JDK Forest into a Single Repository
#Java 9 Features:
- Java platform module system
- Interface Private Methods
- HTTP 2 Client
- JShell
- Platform and JVM Logging
- Process API Updates
- Collection API Updates
- Improvements in Stream API
- Multi-release JAR Files
- @Deprecated Tag Changes
- Stack Walking
#Java 8 Features:
- Lambda expression
- Stream API
- Functional interface
- Default and static methods
- Optional class
- Nashorn — JavaScript runtime engine
- Annotation on Java Types
- Unsigned Integer Arithmetic
- Repeating annotations
- New Date and Time API
References: Oracle official website, java doc, and API specification doc.
#HappyBirthdayjava