Oracle has released Java 25. In this article we will highlight the new features and changes of Java 25, the most recent long-term supported version of Java.

Module imports (JEP 511 - Preview)

In Java 25 we can now import modules using the import statement.

Top level main method (JEP 512)

Java 25 supports top-level main methods. This means that you can now define a method void main() in a .java file and run it. No class or arguments needed. This change was made to make it easier for teaching to write some quick code, as well as for rapid prototyping.

Statements before super (JEP 513)

With JEP 513, officially known as flexible constructor bodies, you can now add code in a constructor before calling super(). This can be used for for example argument validation before calling the super constructor.

Scoped Values (JEP 506)

bla bla

Key Derivation Function (JEP 510)

bla bla

Conclusion