JEP 445, targeted at JDK 21, proposes two beginner-friendly Java improvements: a relaxed launch protocol allowing main methods to be non-public, non-static, and without an args parameter, and unnamed classes that let source files contain methods and fields without an explicit class wrapper. Together these reduce boilerplate so a Hello World becomes just 'void main() { System.out.println("Hello, World!"); }'. A related JEP draft also proposes launching multi-file source-code programs directly with the java launcher, enabling a gradual on-ramp from simple scripts to multi-file projects before requiring a build tool.

8m read timeFrom nipafx.dev
Post cover image
Table of contents
▚ Intro▚ A Relaxed Launch Protocol▚ The Unnamed Class▚ The On-Ramp▚ Outro

Sort: