Draft Spec for Second Preview of Flexible Constructor Bodies (JEP 482)

Gavin Bierman gavin.bierman at oracle.com
Tue May 14 22:13:45 UTC 2024


Dear experts:

The first draft of a spec covering JEP 482 (Flexible Constructor Bodies (Second Preview)) is available at:

https://cr.openjdk.org/~gbierman/jep482/latest/

Feel free to contact me directly or on this list with any comments/corrections.

Thanks,
Gavin

On 14 May 2024, at 20:04, Mark Reinhold <mark.reinhold at oracle.com> wrote:

https://openjdk.org/jeps/482

 Summary: In constructors in the Java programming language, allow
 statements to appear before an explicit constructor invocation, i.e.,
 super(..) or this(..). The statements cannot reference the instance
 under construction, but they can initialize its fields. Initializing
 fields before invoking another constructor makes a class more reliable
 when methods are overridden. This is a preview language feature.

- Mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-spec-experts/attachments/20240514/b7c237ae/attachment.htm>


More information about the amber-spec-experts mailing list