Anonymity and observability of unnamed classes (JEP 445)

Attila Kelemen attila.kelemen85 at gmail.com
Sun May 7 09:11:58 UTC 2023


> 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