A comprehensive collection of Java features, examples, and interview preparation guides covering all versions from Java 1.0 (1996) to Java 25 (2025)
Features β’ Quick Start β’ Documentation β’ Contributing
- Overview
- Key Features
- Java Versions Covered
- Quick Start
- Documentation
- Project Structure
- Examples
- Interview Preparation
- Contributing
- About
Created by Vishal Kamaliya for educational and study purposes.
This repository provides a comprehensive guide to Java programming language evolution, featuring:
- π Detailed README files for each Java version (1.0 to 25)
- π» Practical code examples demonstrating key features
- π Interview preparation guides with common questions
- π Feature explanations with benefits and use cases
- π Organized structure for easy navigation
Whether you're preparing for interviews, learning Java history, or exploring new features, this repository serves as your complete reference guide.
- 25 Java versions documented (Java 1.0 to Java 25)
- 200+ code examples demonstrating features
- Feature-by-feature breakdown with explanations
- Common interview questions for each version
- Code examples with explanations
- Best practices and use cases
- Version-specific directories
- Feature-based categorization
- Easy navigation structure
- Latest Java 25 features included
- LTS versions highlighted
- Deprecation notes where applicable
| Version | Release Year | Status | Key Features | Documentation |
|---|---|---|---|---|
| Java 1.0 | 1996 | β | Core Language, AWT, Applets | π Read More |
| Java 1.1 | 1997 | β | Inner Classes, JDBC, RMI, Reflection | π Read More |
| Java 1.2 | 1998 | β | Collections Framework, Swing, strictfp | π Read More |
| Java 1.3 | 2000 | β | HotSpot JVM, JNDI, JavaSound | π Read More |
| Java 1.4 | 2002 | β | Assertions, Regex, NIO, Logging | π Read More |
| Java 5 | 2004 | β | Generics, Enums, Autoboxing, Annotations | π Read More |
| Java 6 | 2006 | β | Scripting API, Compiler API, JDBC 4.0 | π Read More |
| Java 7 | 2011 | β | Try-with-Resources, Diamond Operator, NIO.2 | π Read More |
| Java 8 | 2014 | β | Lambda, Streams, Optional, Date/Time API | π Read More |
| Java 9 | 2017 | β | Module System, JShell, HTTP/2 Client | π Read More |
| Java 10 | 2018 | β | Local-Variable Type Inference (var) | π Read More |
| Java 11 | 2018 | π LTS | HTTP Client, String Methods, JFR | π Read More |
| Java 12 | 2019 | β | Switch Expressions, JVM Constants API | π Read More |
| Java 13 | 2019 | β | Text Blocks, Switch Expressions | π Read More |
| Java 14 | 2020 | β | Records, Pattern Matching, Helpful NPE | π Read More |
| Java 15 | 2020 | β | Sealed Classes, Hidden Classes, Text Blocks | π Read More |
| Java 16 | 2021 | β | Records Finalized, Pattern Matching | π Read More |
| Java 17 | 2021 | π LTS | Sealed Classes, Pattern Matching, JEP 356 | π Read More |
| Java 18 | 2022 | β | Simple Web Server, UTF-8 by Default | π Read More |
| Java 19 | 2022 | β | Virtual Threads, Record Patterns | π Read More |
| Java 20 | 2023 | β | Scoped Values, Record Patterns | π Read More |
| Java 21 | 2023 | π LTS | Virtual Threads, Pattern Matching, Sequenced Collections | π Read More |
| Java 22 | 2024 | β | Statements Before super(), Stream Gatherers | π Read More |
| Java 23 | 2024 | β | Flexible Constructor Bodies, Module Imports | π Read More |
| Java 24 | 2025 | β | AOT Compilation, Stream Gatherers Finalized | π Read More |
| Java 25 | 2025 | β | Instance Main Methods, Enhanced Pattern Matching | π Read More |
Legend: π = Long-Term Support (LTS) Version
- Java Development Kit (JDK) 8 or higher
- IDE (IntelliJ IDEA, Eclipse, VS Code, etc.)
- Git (for cloning the repository)
git clone https://github.com/yourusername/geeksforgeeks.git
cd geeksforgeeks# Java 8 Lambda Expressions
cd src/java8/foundation
# Java 11 HTTP Client
cd src/java11/httpclient
# Java 17 Sealed Classes
cd src/java17/sealedclasses# Compile
javac ExampleName.java
# Run
java ExampleNameEach Java version has its own comprehensive README.md file covering:
- β Feature Overview - What's new in each version
- π» Code Examples - Practical implementations
- π― Use Cases - When to use each feature
- β Interview Questions - Common questions and answers
- π Links to Examples - Direct links to code files
π Java 1.0 - 1.4 (Foundation Years)
π Java 5 - 7 (Modern Java Foundation)
π Java 8 - 11 (Functional Programming Era)
- Java 8 - Lambda, Streams, Optional, Date/Time API
- Java 9 - Module System, JShell, HTTP/2 Client
- Java 10 - Local-Variable Type Inference (var)
- Java 11 (LTS) - HTTP Client, String Methods, JFR
π Java 12 - 17 (Modern Features)
π Java 18 - 25 (Latest Features)
- Java 18 - Simple Web Server, UTF-8 by Default
- Java 19 - Virtual Threads, Record Patterns
- Java 20 - Scoped Values, Record Patterns
- Java 21 (LTS) - Virtual Threads, Pattern Matching, Sequenced Collections
- Java 22 - Statements Before super(), Stream Gatherers
- Java 23 - Flexible Constructor Bodies, Module Imports
- Java 24 - AOT Compilation, Stream Gatherers Finalized
- Java 25 - Instance Main Methods, Enhanced Pattern Matching
JavaVersionsandFeatures/
β
βββ README.md # This file - Project landing page
β
βββ src/
β βββ java1/ # Java 1.0 features and examples
β β βββ README.md
β β βββ ...
β β
β βββ java1_1/ # Java 1.1 features
β βββ java1_2/ # Java 1.2 features
β βββ java1_3/ # Java 1.3 features
β βββ java1_4/ # Java 1.4 features
β βββ java5/ # Java 5 features
β βββ java6/ # Java 6 features
β βββ java7/ # Java 7 features
β βββ java8/ # Java 8 features
β βββ java9/ # Java 9 features
β βββ java10/ # Java 10 features
β βββ java11/ # Java 11 (LTS) features
β βββ java12/ # Java 12 features
β βββ java13/ # Java 13 features
β βββ java14/ # Java 14 features
β βββ java15/ # Java 15 features
β βββ java16/ # Java 16 features
β βββ java17/ # Java 17 (LTS) features
β βββ java18/ # Java 18 features
β βββ java19/ # Java 19 features
β βββ java20/ # Java 20 features
β βββ java21/ # Java 21 (LTS) features
β βββ java22/ # Java 22 features
β βββ java23/ # Java 23 features
β βββ java24/ # Java 24 features
β βββ java25/ # Java 25 features
β
βββ [Other directories...]
// Traditional approach
Runnable r1 = new Runnable() {
@Override
public void run() {
System.out.println("Hello");
}
};
// Lambda approach
Runnable r2 = () -> System.out.println("Hello");HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.example.com"))
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());public sealed class Shape
permits Circle, Rectangle, Triangle {
// ...
}try (ExecutorService executor = Executors.newVirtualThreadPerTaskExecutor()) {
executor.submit(() -> {
// Lightweight thread
});
}This repository is designed to help you prepare for Java interviews by providing:
- β Feature explanations with code examples
- β Common interview questions with detailed answers
- β Best practices and use cases
- β Code examples you can run and experiment with
- Core Java Concepts - OOP, Collections, Generics
- Modern Java Features - Lambda, Streams, Optional
- Advanced Topics - Modules, Pattern Matching, Virtual Threads
- Performance - Garbage Collectors, JVM internals
- API Enhancements - HTTP Client, Files API, String methods
- Start with Java 8 (most commonly asked)
- Focus on LTS versions (Java 11, 17, 21)
- Practice with code examples
- Review interview questions for each version
Contributions are welcome! Here's how you can help:
- π Report bugs or issues
- π‘ Suggest new features or improvements
- π Add missing examples or documentation
- π§ Fix errors in existing code
- π Improve documentation
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Additional code examples
- More interview questions
- Performance benchmarks
- Best practices documentation
- Translation to other languages
| Metric | Count |
|---|---|
| Java Versions Covered | 25 |
| Total README Files | 25 |
| Code Examples | 200+ |
| Interview Questions | 300+ |
| Features Documented | 500+ |
Java Long-Term Support (LTS) versions receive extended support and are recommended for production:
- Java 11 (LTS) - Released 2018, Support until 2026
- Java 17 (LTS) - Released 2021, Support until 2029
- Java 21 (LTS) - Released 2023, Support until 2031
π‘ Tip: Focus on LTS versions for production applications and interview preparation.
- Start with Java 1.0 - 1.4 (Core concepts)
- Learn Java 5 - 7 (Modern foundation)
- Master Java 8 (Functional programming)
- Explore Java 9+ (Latest features)
- Review Java 8 - 11 (Most commonly used)
- Study Java 17 (LTS) (Current LTS)
- Explore Java 21 (LTS) (Latest LTS)
- Check Java 22 - 25 (Cutting-edge features)
Author: Vishal Kamaliya
This repository is created for educational and study purposes to help developers understand Java evolution from version 1.0 to 25. All content is organized for learning, interview preparation, and reference.
- π Educational Resource - Learn Java features across all versions
- π Study Guide - Comprehensive preparation material
- πΌ Interview Preparation - Common questions and answers
- π Reference Material - Quick lookup for Java features
This is a study and educational resource. It is not affiliated with Oracle, OpenJDK, or any Java license. All Java-related trademarks belong to their respective owners.
- Oracle and OpenJDK community for Java language development
- Contributors who have helped improve this repository
- Java community for continuous feedback and suggestions
If you find this repository helpful, please consider giving it a β star!
Questions? Open an Issue
Want to contribute? See Contributing section
Created by Vishal Kamaliya for Study and Educational Purposes
Last Updated: 2025