Unnamed Classes with Initializers

David Alayachew davidalayachew at gmail.com
Tue Jul 4 13:17:13 UTC 2023


Hello Brian,

Thank you for your response!

Maybe me and Wesley are somehow wildly misreading the JEP, but here is a
copy-and-paste. -- https://openjdk.org/jeps/445

"An unnamed class is almost exactly like an explicitly declared class. Its
members can have the same modifiers (e.g., private and static) and the
modifiers have the same defaults (e.g., package access and instance
membership).

**The class can have static initializers as well as instance initializers.**

One key difference is that while an unnamed class has a default
zero-parameter constructor, it can have no other constructor."

Are we misreading this JEP?

Thank you for your time and help!
David Alayachew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20230704/99b923e7/attachment-0001.htm>


More information about the amber-dev mailing list