Java Cup
Inside Java

News and views from members of the Java team at Oracle

Java Initialization 2.0 #JVMLS

(Recorded at JVMLS 2024 - for more, check our JVMLS 2024 playlist.)

Dan Smith explores how changes to the Java language, JVM, and coding practices can strengthen field-initialization guarantees. The goals include avoiding default values, ensuring that final fields cannot be observed to change, and preventing publication of objects before initialization is complete.

The talk connects Flexible Constructor Bodies in Project Amber, which allow earlier field initialization, with Project Valhalla's use of the ACC_STRICT flag to support stronger guarantees for value classes.

Additional Resources