New in Java 25 in Java

From the Java cheat sheet · Modern Java (25) · verified Jul 2026

New in Java 25

Finalized features that simplify everyday code.

java
// Quick Reference
void main() {                 // compact source file (JEP 512)
    IO.println("Hi!");
}
import module java.base;      // module import (JEP 511)
💡 Java 25 is the current LTS (Sept 2025) - these features are final, not preview.
⚡ Compact source files remove class/static/String[] boilerplate for scripts and learning.
📌 java.lang.IO (println/readln) is auto-imported in compact source files.
🟢 Flexible constructor bodies let you validate arguments before calling super().
java25modern

More Java tasks

Back to the full Java cheat sheet