Sitemap
Kunal Pagare

Kunal Pagare

Java Versions After Java 8

3 min readJul 4, 2024

Here’s a breakdown of Java versions released after Java 8, along with key changes:

Get Kunal Pagare’s stories in your inbox

Join Medium for free to get updates from this writer.

Java 9 (September 2017)

  • Module System (Project Jigsaw): Introduced modularity to Java, allowing developers to create and maintain larger applications more easily.
  • JShell (REPL): Interactive Read-Eval-Print Loop for experimenting with Java code snippets.
  • Improved Streams API: New methods and enhancements for working with streams of data.
  • Private Interface Methods: Allowed private methods within interfaces to share code among default methods.
  • HTTP/2 Client: New API for efficient communication using the HTTP/2 protocol.

Java 10 (March 2018)

  • Local-Variable Type Inference (var keyword): Reduced verbosity by inferring data types for local variables.
  • Garbage-Collector Interface: Improved garbage collection isolation and modularity.
  • Application Class-Data Sharing: Reduced startup time and footprint for small applications.

Java 11 (September 2018) (LTS — Long-Term Support)

  • New String Methods: Added methods like isBlank(), lines(), and strip() for easier string manipulation.
  • Running Java Files Directly: Simplified running single-file Java programs without explicit compilation.
  • HTTP/2 Client (Standardized): The HTTP/2 Client API became a standard feature.
  • Epsilon Garbage Collector: A “no-op” garbage collector for performance testing and specific use cases.

Java 12 (March 2019)

  • Switch Expressions (Preview): Introduced a more concise and expressive way to write switch statements.
  • Shenandoah Garbage Collector (Experimental): A low-pause-time garbage collector.

Java 13 (September 2019)

  • Switch Expressions (Second Preview): Further refinements to switch expressions.
  • Text Blocks: Introduced multiline string literals for easier handling of formatted text.

Java 14 (March 2020)

  • Switch Expressions (Standard): Switch expressions became a standard language feature.
  • Records (Preview): Introduced a concise way to define data classes.
  • Pattern Matching for instanceof (Preview): Improved pattern matching capabilities.

Java 15 (September 2020)

  • Records (Second Preview): Further refinements to records.
  • Sealed Classes (Preview): Allowed developers to restrict which classes can inherit from a class or interface.
  • Hidden Classes: Improved performance and security by hiding implementation details from other classes.

Java 16 (March 2021)

  • Records (Final): Records became a standard language feature.
  • Pattern Matching for instanceof (Final): Pattern matching for instanceof became a standard feature.
  • Sealed Classes (Final): Sealed classes became a standard feature.

Java 17 (September 2021) (LTS)

  • Sealed Classes Enhancements: Improved usability and flexibility of sealed classes.
  • Pattern Matching for switch (Preview): Extended pattern matching to switch statements.
  • New macOS Rendering Pipeline: Improved performance and security for Java applications on macOS.

Java 18 (March 2022)

  • UTF-8 by Default: Made UTF-8 the default character set for various APIs.
  • Simple Web Server: Introduced a minimal web server for development and testing purposes.
  • Code Snippets in Java API Documentation: Allowed code snippets to be directly included in API documentation.

Java 19 (September 2022)

  • Record Patterns (Preview): Enhanced pattern matching to work with record components.
  • Virtual Threads (Preview): Introduced lightweight, user-level threads for improved concurrency.
  • Structured Concurrency (Incubator): Provided a framework for managing groups of related tasks.

Java 20 (March 2023)

  • Record Patterns (Second Preview): Further refinements to record patterns.
  • Scoped Values (Second Incubator): Improved data sharing and management within threads.
  • Switch Pattern Matching Enhancements: Improved the usability and expressiveness of switch pattern matching.

Java 21 (September 2023) (LTS)

  • Virtual Threads (Final): Virtual threads are now a standard feature.
  • Structured Concurrency (Final): Structured concurrency is now a standard feature.
  • Record Patterns (Final): Record patterns are now a standard feature.
  • String Templates (Preview): A new way to create strings with embedded expressions.

Java 22

  1. Scoped Values:
  • Scoped values introduce a novel approach to managing shared data within a thread or across child threads.
  • Advantages over traditional thread-local variables include immutability, automatic lifecycle management, and thread-safe sharing.
  • No more complex synchronization mechanisms!

2. Stream Gatherers:

  • Stream gatherers provide a more efficient way to collect results from streams.
  • They enhance stream processing capabilities.

3. Structured Concurrency:

  • Offers a more intuitive approach to managing concurrent tasks.
  • Simplifies concurrent programming.

4. Statements Before Super:

  • Allows statements to appear before the super constructor call.
  • Improves code readability.

5. Class-File API:

  • Provides a programmatic interface for reading and writing class files.
  • Useful for bytecode manipulation and analysis.

6. Region Pinning for G1 Garbage Collector (G1 GC):

  • Optimizes memory management, leading to faster applications.

7. String Templates (Second Preview):

  • Enhances string formatting capabilities.

8. Unnamed Variables and Patterns:

  • Improves code maintainability and readability.

--

--