Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumKotlinproperty delegation lazySingle-choice MCQ

A `by lazy` initializer throws an exception on first access. What happens on the next access to the same property (default SYNCHRONIZED mode)?

val value: String by lazy { println("computing") error("boom") } fun main() { runCatching { value } runCatching { value } // second access }