Implement a generic 'Box' class that can store any type of item. Add methods set() and get().
Generic builder
Generic box
Report a typo
Sample Input 1:
1
HelloSample Output 1:
The integer in the box is: 1
The string in the box is: HelloWrite a program in Kotlin
class Box<T>(var value: T) {
//write your code here
}
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.