r/JavaProgramming • • Mar 22 '26

Java Cheat Sheet From Java 8 → ( Java 21 + Modern Features)

JAVA 8 — LTS

  1. Lambda Expressions

  2. Functional Interfaces

  3. Stream API

  4. Method References

  5. Optional<T>

  6. New Date & Time API

  7. Default & Static Methods in Interfaces

  8. Collectors & Parallel Streams

JAVA 9 — Modules & Improvements

  1. Collection Factory Methods

  2. Stream API Enhancements

  3. Private Methods in Interfaces

  4. HTTP/2 Client (Incubator)

  5. Improved Process API

JAVA 10 — Type Inference & More

  1. Local Variable Type Inference (var)

  2. Optional.orElseThrow()

JAVA 11 — LTS — String & HTTP

  1. New String Methods

  2. New Files Methods

  3. HTTP Client (Finalized)

JAVA 12 — Compact Numbers & String Indent

  1. Compact Number Formatting

  2. String.indent() & Collectors.teeing()

JAVA 13 — Minor Updates

Java 13 continued previewing Text Blocks and Switch Expressions, which were finalized in later versions. There are no major standalone features unique to Java 13.

JAVA 14 — Switch Expressions & Helpful NPE

  1. Switch Expressions (Finalized)

  2. Helpful NullPointerExceptions

  3. Records (Preview → Java 16 Final)

JAVA 15 — Text Blocks & Sealed Classes Preview

  1. Text Blocks (Finalized)

JAVA 16 — Pattern Matching & Records Final

  1. Pattern Matching for instanceof

  2. Records — Finalized in Java 16

  3. Stream.toList() & mapMulti()

JAVA 17 LTS — Sealed Classes

  1. Sealed Classes & Interfaces

  2. Pattern Matching for Switch (Preview)

JAVA 18 — UTF-8 Default & Simple Server

  1. UTF-8 by Default

  2. Simple Web Server

  3. Deprecate Finalization for Removal

JAVA 19–20 — Preview & Incubator

  • Virtual Threads (Preview) — finalized in Java 21

  • Record Patterns (Preview) — finalized in Java 21

  • Pattern Matching for switch (Preview) — finalized in Java 21

  • Structured Concurrency (Incubator) — preview in 21

  • Foreign Function & Memory API (Preview) — replaces JNI

JAVA 21 LTS — The Modern Java

  1. Virtual Threads (Project Loom)

  2. Record Patterns (Finalized)

  3. Sequenced Collections

  4. Pattern Matching for Switch (Final)

  5. String Templates (Preview in 21)

i explained everything here (Free Medium article)

49 Upvotes

Duplicates