Welcome to the Java Evolution repository, where we document the journey of Java from version 8 through 25, covering all the major features and changes introduced in each version. This repository aims to serve as a comprehensive guide for developers at all levels to understand the evolution of Java, enabling them to make the most of the language's capabilities in their projects.
Our goal is to provide a detailed exploration of each feature introduced in Java from version 8 onwards, including examples and explanations to help Java developers grasp the concepts and apply them in practice.
- Version Directories: The repository is organized into directories named after each Java version (e.g., Java_8, Java_9, etc.), containing detailed documentation and examples for the features introduced in that version.
- README Files: Each version directory includes a README.md with an overview of the key features introduced in that version, along with links to detailed explanations or code examples where applicable.
- Feature Documentation: Complex features have their own Markdown files or code examples within the relevant version directory, providing a deeper dive into their usage and benefits.
- To explore the features introduced in a specific version of Java, navigate to the corresponding version directory.
- For an overview of the features in each version, refer to the README.md files within each version directory.
- For detailed explanations and examples of specific features, look for additional Markdown files or code examples within the version directories.
We welcome contributions from the community! Whether you'd like to add examples, improve explanations, or update the documentation for newer Java versions, your input is valuable. Please refer to the CONTRIBUTING.md file for guidelines on how to contribute effectively.
Below is a brief overview of the key features introduced in Java from version 8 to 21. This serves as a starting point for the detailed documentation you'll find in this repository.
Lambda Expressions, Streams API, Date and Time API, Default Methods, Type Annotations
Module System (Project Jigsaw), JShell, Private Interface Methods, Immutable Collections
Local-Variable Type Inference (var), Application Class-Data Sharing
HttpClient API (Standard), New String Methods, Local-Variable Syntax for Lambda Parameters
Switch Expressions (Preview), Compact Number Formatting
Text Blocks (Preview), Switch Expressions (Standard)
Records (Preview), Pattern Matching for instanceof (Preview), Helpful NullPointerExceptions
Sealed Classes (Preview), Text Blocks (Standard), Pattern Matching for instanceof (Second Preview)
Records (Standard), Pattern Matching for instanceof (Standard), Sealed Classes (Second Preview)
Sealed Classes (Standard), Pattern Matching for Switch (Preview), New macOS Rendering Pipeline
Simple Web Server (Incubator), Code Snippets in Java API Documentation
Virtual Threads (Preview), Structured Concurrency (Incubator), Pattern Matching for Switch (Second Preview)
Record Patterns (Preview), Pattern Matching for Switch (Standard)
Virtual Threads (Standard), Sequenced Collections, Pattern Matching for Switch (Standard), Record Patterns (Standard)
Unnamed Variables and Patterns (Standard), Stream Gatherers (Preview), Foreign Function & Memory API (Standard), String Templates (Second Preview)
Primitive Types in Patterns (Preview), Flexible Constructor Bodies (Second Preview), Markdown Documentation Comments, Module Import Declarations (Preview), ZGC Generational Mode by Default
Scoped Values (Fourth Preview), Stream Gatherers (Third Preview), Structured Concurrency (Fourth Preview), Class-File API (Third Preview), Late Barrier Expansion for G1
Stream Gatherers (Expected Final), Scoped Values (Expected Final), Structured Concurrency (Expected Final), Potential Value Types (Preview)
For more in-depth information and the latest updates on Java, please refer to the official Java documentation and JDK Enhancement Proposals (JEPs).
Java continues to evolve, and so will this repository. We aim to regularly update the documentation with the latest features and improvements. Your contributions and feedback are essential to keeping this resource valuable and up-to-date.
- β Implemented - Code examples and tests available
- β³ Pending - Documented but implementation needed
- π Documented - README available
Feature | Status | Location |
---|---|---|
Lambda Expressions | β Implemented | Java8/src/main/java/com/javaevolution/lambda/ |
Streams API | β Implemented | Java8/src/main/java/com/javaevolution/streams/ |
Date and Time API | β Implemented | Java8/src/main/java/com/javaevolution/dateandtime/ |
Default Methods | β Implemented | Java8/src/main/java/com/javaevolution/defaultmethods/ |
Optional Class | β Implemented | Java8/src/main/java/com/javaevolution/optional/ |
Method References | β Implemented | Java8/src/main/java/com/javaevolution/lambda/methodreferences/ |
Functional Interfaces | β Implemented | Java8/src/main/java/com/javaevolution/lambda/functionalinterfaces/ |
Feature | Status | Location |
---|---|---|
Private Interface Methods | β Implemented | Java9/src/main/java/com/javaevolution/privateinterface/ |
Immutable Collections | β Implemented | Java9/src/main/java/com/javaevolution/immutable/ |
Module System | π Documented | Java9/README.md |
JShell | π Documented | Java9/README.md |
Feature | Status | Location |
---|---|---|
Local Variable Type Inference (var) | β Implemented | Java10/src/main/java/com/javaevolution/var/ |
Feature | Status | Location |
---|---|---|
HttpClient API | β Implemented | Java11/src/main/java/com/javaevolution/httpclient/ |
String Methods | β Implemented | Java11/src/main/java/com/javaevolution/stringmethods/ |
Feature | Status | Location |
---|---|---|
Switch Expressions | β Implemented | Java12/src/main/java/com/javaevolution/switchexpr/ |
Compact Number Formatting | β Implemented | Java12/src/main/java/com/javaevolution/compactnumber/ |
Feature | Status | Location |
---|---|---|
Text Blocks | β Implemented | Java13/src/main/java/com/javaevolution/textblocks/ |
Feature | Status | Location |
---|---|---|
Records | β Implemented | Java14/src/main/java/com/javaevolution/records/ |
Pattern Matching for instanceof | β Implemented | Java14/src/main/java/com/javaevolution/patternmatching/ |
Feature | Status | Location |
---|---|---|
Sealed Classes | β³ Pending | - |
Text Blocks (Standard) | β See Java 13 | Java13/ |
Feature | Status | Location |
---|---|---|
Records (Standard) | β See Java 14 | Java14/src/main/java/com/javaevolution/records/ |
Pattern Matching (Standard) | β See Java 14 | Java14/src/main/java/com/javaevolution/patternmatching/ |
Feature | Status | Location |
---|---|---|
Sealed Classes | β³ Pending | - |
Pattern Matching for Switch | β³ Pending | - |
Feature | Status | Location |
---|---|---|
Simple Web Server | β³ Pending | - |
Feature | Status | Location |
---|---|---|
Virtual Threads | β See Java 21 | Java21/src/main/java/com/evolution/virtualthreads/ |
Structured Concurrency | β³ Pending | - |
Feature | Status | Location |
---|---|---|
Record Patterns | β³ Pending | - |
Feature | Status | Location |
---|---|---|
Virtual Threads | β Implemented | Java21/src/main/java/com/evolution/virtualthreads/ |
Sequenced Collections | β³ Pending | - |
String Templates | β³ Pending | - |
Pattern Matching for Switch | β³ Pending | - |
Record Patterns | β³ Pending | - |
Feature | Status | Location |
---|---|---|
Unnamed Variables and Patterns | β Implemented | Java22/src/main/java/com/javaevolution/unnamedpatterns/ |
Stream Gatherers | β Implemented | Java22/src/main/java/com/javaevolution/streamgatherers/ |
Foreign Function & Memory API | π Documented | Java22/README.md |
String Templates | π Documented | Java22/README.md |
Feature | Status | Location |
---|---|---|
Primitive Types in Patterns | β Implemented | Java23/src/main/java/com/javaevolution/primitivetypes/ |
Flexible Constructor Bodies | β Implemented | Java23/src/main/java/com/javaevolution/flexibleconstructors/ |
Markdown Documentation | π Documented | Java23/README.md |
Module Import Declarations | π Documented | Java23/README.md |
Feature | Status | Location |
---|---|---|
Scoped Values | β Implemented | Java24/src/main/java/com/javaevolution/scopedvalues/ |
Stream Gatherers (Third Preview) | π Documented | Java24/README.md |
Structured Concurrency | π Documented | Java24/README.md |
Class-File API | π Documented | Java24/README.md |
Feature | Status | Location |
---|---|---|
Advanced Stream Gatherers | β Implemented | Java25/src/main/java/com/javaevolution/streamgatherers/ |
Scoped Values (Final) | π Documented | Java25/README.md |
Structured Concurrency (Final) | π Documented | Java25/README.md |
Value Types | π Documented | Java25/README.md |
./gradlew build
# Test all modules
./gradlew test
# Test specific Java version
./gradlew :Java8:test
./gradlew :Java14:test
Each Java version directory contains:
src/main/java/
- Implementation examplessrc/test/java/
- Comprehensive unit testsREADME.md
- Feature documentation
Start with Java 8 to understand foundational features, then progress through versions to see how Java has evolved.
- 25+ feature categories covered across Java 8-25
- 38+ implementation classes with working examples
- 38+ test classes with comprehensive coverage
- 25,000+ lines of code demonstrating Java features
- Comprehensive documentation for Java 22-25 features
- All tests passing for Java 8-14, 22-25 (compatible implementations)
See CONTRIBUTING.md for guidelines on contributing to this repository.
For a detailed analysis of feature coverage, see FEATURE_ANALYSIS.md.