How’s it going there?
Whether you’re a student learning your first “Hello, World” or an experienced developer writing quick prototypes, Java 25 streamlines the experience. For decades, this was a barrier. Beginners had to learn about classes, static methods, arrays, String, System.out, packages, imports, the main keyword's meaning, and public access modifiers before they could even print text.
But it is not Java 25 that brings it all; it's been a while since a lot of stuff has been happening. Let's see some of the evolution.
In almost all of those JEP summaries, you can see this:
“Evolve the Java language so that students can write their first programs without needing to understand language features designed for large programs.”
Java 21 – Unnamed Classes and Instance Main Methods (JEP 445)
Unnamed classes: Programs could omit the class declaration entirely; the compiler would wrap top-level methods into an unnamed class.
Instance main methods introduced: You no longer need public static void main(String[] args). Instead, you can declare void main() or void main(String[] args) as an instance method inside a class.
Java 22 – Implicitly Declared Classes and Instance Main Methods (JEP 463)
The “unnamed classes” concept was replaced in Java 22 with a more streamlined and intuitive model: implicitly declared classes, or implicit classes. Instead of requiring a special classification, the compiler now treats any top-level code without an explicit class declaration as belonging to a standard class automatically generated by the compiler. This class is given a host-determined name (the name of your .java file), is final, belongs to the unnamed package, extends Object, and cannot implement interfaces—yet functions like a regular class in behavior.
Java 23 – Implicitly Declared Classes and Instance Main Methods (JEP 477)
No need to reference System.out and wonder what it means. They introduced a new IO class with print/read features (print, println, readln), and the amazing part is that these methods are auto-imported, so you can directly write println("Hello, World!");. In addition, all public classes in java.base are now auto-imported, making types like List, File, or BigDecimal usable with zero ceremony.
Java 24 – Simple Source Files and Instance Main Methods (JEP 495)
It looks like nothing has been changed in the code feature here, but they decided to unify the feature under the name simple source files instead of implicit classes.
Java 25 – Compact Source Files and Instance Main Methods (JEP 512)
The static methods originally provided in java.io.IO (println, …) have been moved to java.lang.IO (and since everything in java.lang is imported by default, they are now more accessible).
These operations are now based on System.out/System.in rather than the Console API. However, the static methods of the IO class are no longer implicitly imported into compact source files. This means that method calls must explicitly reference the class.
Compact source files automatically access all public classes and interfaces from java.base module (i.e., import module java.base;).
Java 25 – Flexible Constructor Bodies (JEP 513)
One important part of this flow is constructor chaining. If a class has a parent class, Java ensures that the parent constructor runs before the child constructor logic. This guarantees that the object is built step by step, starting from the top of the inheritance hierarchy.
This improves this situation because it allows certain statements to appear before #super() or #this() calls, making constructors more expressive and readable.
This is not an exhaustive list, and I really suggest you go there and try out some examples of each one to really get a good understanding of those benefits.
VSCode Plugin
Did you know that you can run a simple Hello World in one line of code without knowing anything?
There's a nice VSCode plugin that also introduces Interactive Java Notebooks (IJNB), which allow you to create notebooks that combine formatted text (Markdown), executable Java code, and execution results in any order.
Let's do a simple test;
You just need to install VSCode and install the plugin; that is it. If you don’t have Java on your machine, the plugin will ask you to auto-install it for you. Of course, choose Java 25.
Open a new notebook, and that’s it: a Java Hello World in one line.

Sample Code 1: Hello World in One Line
Launching Simple Source-Code Programs
Another nice point here. This can be a great way to learn how to use Java or explore new features within the Java API, without having to go through the cruft of compiling and then executing code. A simple Java as a JavaScript.

Sample Code 2: Hello World from Terminal
To really understand what’s happening under the hood here, I suggest using the javap tool to disassemble the file.

Sample Code 3: Javap Disassemble the File Result
The output shows that the Java compiler automatically generated a FileName class with the default constructor. This behavior shows that while the syntax has been simplified, the underlying Java class structure is still preserved. In short, the Java compiler writes the class for us with the class name named after the source file name.
Video: Dan Vega Talking About Java Is Verbose Back in 2024
Call to Action
Go there and try to explore those things. Let me know what your thoughts are. Any JEP or anything else that I forgot to add in this list? I would love to hear from you.
From now on, if you see anyone saying that Java is verbose, you can simply send this blog post link.
Conclusion
The Java evolution shows a clear vision: making Java simpler for small programs, powerful for big ones.
Java 25 marks a turning point. With compact source files and instance main methods, Java finally aligns with beginner expectations while preserving its scalability for enterprise use, a game-changing feature that dramatically reduces boilerplate code for simple programs. With those updates, Java finally offers a beginner-friendly way to write code without the overhead of explicit classes, public static void main, or import statements—making the language more accessible than ever.
Remember, you can have an if-else in one line; you can use the "Ternary Operator", but this might translate into more difficult code to read and understand. So a lower number of lines does not necessarily mean better code. Sometimes being verbose is a good thing.
There is much more to explore regarding Java in a single file, Java as scripts in terminal, and Java in a notebook.
Links
I really recommend this 2022 blog from Brian Goetz that might be the beginning of the JEP 512 initiative
The Unnamed Classes Documentation
Did you know about “JEP 519: Compact Object Headers” that comes with the idea to reduce the object header size? Does this mean that we can say that Java is not slow anymore? Stay tuned here for the next blog “Stop Saying Java Is Slow.”
Top comments (0)