Language Początkujący

Write a complete program without class declaration or public static void main.

✕ Java 8
public class HelloWorld {
    public static void main(String[] args) {
        System.out.println(
            "Hello, World!");
    }
}
✓ Java 25
void main() {
    IO.println("Hello, World!");
}
Widzisz problem z tym kodem? Daj nam znać.
🚀

Zero ceremony

No class, no public static void main, no String[] args.

🎓

Beginner-friendly

New programmers can write useful code from line 1.

📝

Script-like

Perfect for quick prototypes, scripts, and examples.

Stare podejście
Main Class Ceremony
Nowoczesne podejście
void main()
Od JDK
25
Poziom trudności
Początkujący
Compact source files
Dostępne

Finalized in JDK 25 LTS (JEP 512, Sept 2025).

Compact source files remove the ceremony of class declarations and the main method signature for simple programs. Combined with implicit import of java.io.IO, even println is available directly.

Udostępnij 𝕏 🦋 in