Correct the usage of a non-generic class

Report a typo

Initialize an object of the non-generic class Holder to make the code in the main method compile.

The program should print 256.

Sample Input 1:

Sample Output 1:

256
Write a program in Kotlin
class Holder(var value: Any) {
fun set(newValue: Any) {
value = newValue
}

fun get(): Any {
return value
}
}

fun main() {
val holder: Holder = Holder(0)
holder.set(256)

// correct the line to make the code compile
val value: Int = holder.get()

// do not change
println(value)
}
___

Create a free account to access the full topic