Unnamed Classes with Initializers

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


Hello Jim,

Thank you for your response!

Ok, that clarifies everything.

Thank you for your help!
David Alayachew


On Tue, Jul 4, 2023 at 9:53 AM Jim Laskey <james.laskey at oracle.com> wrote:

> That statement was left in error and has now been removed,
>
> On Jul 4, 2023, at 10:17 AM, David Alayachew <davidalayachew at gmail.com>
> wrote:
>
> 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/ba3ab720/attachment.htm>


More information about the amber-dev mailing list