Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardKotlinJVM memory model happens-beforeSingle-choice MCQ

What does the JMM guarantee about an object's final fields after its constructor finishes, and what subtle requirement breaks that guarantee?

class C { val x: Int // backing field is final init { x = compute() } // ... }