Create a type alias for InnerBox with an appropriate name corresponding to the created instance of this type in the main function. With the help of the method getSomethingFromBox(), output the number of items the object stores.
Type aliases
Opening boxes
Report a typo
Write a program in Kotlin
class BiggerBox() {
class InnerBox<T>(var items: List<T>) {
fun getSomethingFromBox(): List<T> {
return items
}
}
}
typealias Box<T> = // write your code
fun main() {
var box = Box(listOf("lion", "rose"))
// print the number of items
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.