Complete the code to declare a lazy property named value initialized with 10.
val value by [1] { 10 }
The lazy function is used to delegate a property that is initialized only when accessed for the first time.
Complete the code to print the lazy property value.
println([1])Lazy properties are accessed like normal properties without parentheses.
Fix the error in the lazy property declaration by completing the code.
val number by [1] 42
The lazy function requires a lambda block to initialize the value, so you must use curly braces {}.
Fill both blanks to create a lazy property text initialized with "Hello" and print it.
val text by [1] { "Hello" } println([2])
The property text is delegated by lazy and accessed directly by its name.
Fill all three blanks to create a lazy property count initialized with 5, print it, and then print count multiplied by 2.
val count by [1] { 5 } println([2]) println([3] * 2)
The property count is delegated by lazy, accessed directly to print its value and to multiply it.