Guess what's in the box

Report a typo

You have a generic class Box that stores a value of some type. Define an extension function guessBox() that prints the following line : "In this box you have: ITEM", where ITEM is the content of the box.

Write a program in Kotlin
class Box<T>(val item: T)

// define the function
fun <T> Box<T>.guessBox() {

}
___

Create a free account to access the full topic