What type is chosen as parameter type T in the following code:
val box = Box(0L)
box.set(10L)
Here, Box is a generic class:
class Box<T> (var value: T) {
fun set(newValue: T) {
value = newValue
}
}What type is chosen as parameter type T in the following code:
val box = Box(0L)
box.set(10L)
Here, Box is a generic class:
class Box<T> (var value: T) {
fun set(newValue: T) {
value = newValue
}
}Create a free account to access the full topic