Anonymity and observability of unnamed classes (JEP 445)

Brian Goetz brian.goetz at oracle.com
Sun May 7 16:23:14 UTC 2023


Where do you get the idea that main methods are inplicitly static?

Sent from my MacBook Wheel

> On May 7, 2023, at 5:12 AM, Attila Kelemen <attila.kelemen85 at gmail.com> wrote:
> 
> 
>> 
>> If you want applications and jars, i think you are not "programming-in-the-small" as the JEP call it.
>> As you notice, unnamed classes are not very suitable for what you want.
> 
> Maybe, but in some cases I might need that, if I'm indirectly calling
> `java`, and need the jar. What I was considering is that I could have
> used this for Apache Spark to create a script that packages this
> simplified Java file, and then I could use this script to start these
> unnamed classes, which could be very small. On a side note: I find it
> even stranger now that the JEP does not consider this a new dialect,
> but implicit static is a new dialect (despite the precedence for it in
> the language), even though with implicit static it wouldn't have to be
> unnamed to hide from others for being ashamed of itself.


More information about the jdk-dev mailing list