Java features by release
What each release added, the problem it solved, and how you did it before — with the interview questions and scenario questions each feature gets asked as. The "before" is the half that interviewers actually probe.
- Releases
- 17
- Features
- 58
- Questions
- 143
- Scenarios
- 29
- 6 features · 14 questions · 4 scenarios
The current LTS — and a much easier first day for beginners
Two threads run through 25. Several long-running previews finally went final, and a group of changes aimed squarely at newcomers landed together, making a first Java program dramatically shorter than the ceremony people have complained about for twenty years.
- 3 features · 8 questions · 1 scenarios
Stream gatherers, and virtual threads stop pinning
Two changes that matter in production. Stream gatherers finally made the Stream API extensible, and JEP 491 removed the synchronized-block pinning that was the main practical caveat when adopting virtual threads.
- 2 features · 3 questions · 0 scenarios
Markdown in Javadoc, and generational ZGC by default
A small release. The change developers notice is being able to write documentation comments in Markdown instead of HTML.
- 3 features · 5 questions · 0 scenarios
Unnamed variables, and the foreign function API goes final
The release that made calling native code a supported, safe operation instead of JNI, and added a small syntax that removes a whole category of unused-variable noise.
- 6 features · 16 questions · 5 scenarios
Virtual threads, and pattern matching finished
The most consequential release since 8. Virtual threads changed how a Java service handles concurrency, and the pattern-matching work that started in 14 finally arrived complete.
- 3 features · 8 questions · 2 scenarios
Sealed classes, and JDK internals locked down
The LTS most teams migrated to after 8 and 11. Sealed classes completed the data-modelling trio with records and pattern matching, and strong encapsulation of JDK internals became the default rather than a warning.
- 2 features · 6 questions · 1 scenarios
Records and instanceof patterns go final
A short release that finalised two features people had been using in preview for two years, and made strong encapsulation the default.
- 2 features · 5 questions · 2 scenarios
Text blocks, and helpful NullPointerExceptions by default
Two quality-of-life changes that developers notice every day: multi-line strings without escaping, and NPE messages that name what was null.
- 1 features · 2 questions · 0 scenarios
Text blocks and switch expressions, both in preview
Mostly a staging release: two features people wanted were previewed here and finalised in 14 and 15. Useful mainly as an illustration of how the preview process works.
- 1 features · 3 questions · 1 scenarios
Switch expressions previewed
Small, and notable for beginning the pattern-matching work that ran through to 21 — switch becoming an expression was the first step.
- 4 features · 9 questions · 2 scenarios
The first LTS after 8, and the one many teams still run
The migration target for everyone leaving 8, and the release that removed Java EE modules — which is why that upgrade broke builds far more often than the language changes suggested.
- 1 features · 3 questions · 1 scenarios
var, and the six-month release train begins
Small in content and large in consequence — this was the first release of the six-month cadence, which is why Java version numbers started moving so quickly.
- 4 features · 9 questions · 2 scenarios
Modules, and a lot of quiet internal change
Remembered for JPMS, which most application developers never adopted directly, while the changes they actually feel — compact strings, indified concatenation, collection factories — arrived in the same release with far less attention.
- 6 features · 19 questions · 5 scenarios
The release that changed how Java is written
Still the most consequential Java release, and still the baseline many codebases run. Lambdas and streams changed idiom rather than just adding APIs, and the knock-on effects reached the design of every library since.
- 7 features · 14 questions · 1 scenarios
Project Coin — the small changes you use every day
Not a headline release, but its small language changes are in almost every Java file written since: try-with-resources, the diamond operator, switch on String and multi-catch. It also moved the string pool out of PermGen.
- 1 features · 2 questions · 0 scenarios
No language changes — performance and tooling only
Worth knowing precisely because it is the exception: Java 6 added no language features. Everything in it was library, performance or tooling. If an interviewer asks what 6 added and you say "nothing to the language", that is the right answer.
- 6 features · 17 questions · 2 scenarios
Generics, enums, annotations — the other release that changed Java
Before 8, this was the big one. Generics, enums, autoboxing, varargs, the enhanced for loop and java.util.concurrent all arrived together, and it also fixed the memory model — which is why every correct answer about volatile starts here.
Status and JEP numbers are taken from the OpenJDK project pages. Code samples are compiled and run on every build and their output diffed — but this site builds on JDK 21, so samples for Java 22 and later are shown without that guarantee and are labelled accordingly.