<div dir="ltr">Hi all,<div><br></div><div>Quick question: Java is often criticized for having too much emphasis on Object Oriented Programming, with every method having to be marked static repeatedly if one wants to opt out of OOP. Recently, unnamed classes and instance main methods were released into Java 21, which got me thinking: Can we somehow use them (unnamed classes) to facilitate top level "classless" methods in Java? Obviously, the methods would in actuality belong to the unnamed class and aren't actually classless, and internally would be static to avoid relying on object instances (since they're supposed to be top level). Whether or not we'd want to support top level global variables this way too I leave up to discussion. Or maybe there's a different way to have free form methods (such as with Kotlin) without having to mark entire utility classes as static somehow?</div><div><br></div><div>Thoughts?</div><div><br></div><div>best regards,</div><div>Julian</div></div>