15 lines
285 B
Text
15 lines
285 B
Text
package main
|
|
|
|
data class Box<T>(var value: T) {
|
|
fun get(): T { return value }
|
|
}
|
|
|
|
fun identity<T>(value: T): T { return value }
|
|
|
|
fun main() {
|
|
val number = identity(42)
|
|
val text = identity<String>("value")
|
|
val box = Box(text)
|
|
println(number)
|
|
println(box.get())
|
|
}
|