class A<T>(val t: T) { fun print() { println(t!!::class.java.simpleName) } } class B {} fun main() { val b = B() A(b).print() }
B
fun main() { A(B::class).print() }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)