Main() without Class (and it’s not Kotlin)

Gaetano Piazzolla
3 min readJun 8, 2023

Jdk 21 has just reached Rampdown Phase One and will be released with some awesome features such as Virtual Threads, sequenced collections, generational ZGC, and pattern matching.

As if that weren’t enough, Java is becoming more accessible to new programmers thanks to this JEP (Java Enhancement Proposal) 445: Unnamed Classes and Instance Main Methods.

In this short tutorial, we’ll take a look at He-Who-Must-Not-Be-Named.

--

--