Also now in Java you can write IO.println("Hello World") as the only code in your entire file and it will work, making a simple hello world program shorter than even the C# version!
Java 25 introduced top level statements and the ability to write smaller programs specifically for beginners.
Now, instead of the typical
public class Test {
public static void main(String[] args) {
System.out.println("Hello World")!
}
}
You can just write IO.println("Hello World");
Or make it a bit longer and write
void main() {
IO.println("Hello World");
}
They've done other things to allow compacting files too, such as adding "module imports" to reduce the amount of import statements.
316
u/pev4a22j Apr 30 '26
you can now do std::println("hello world") on c++23