Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Generic class
- class Grocery()
- class PaintShop()
- class Shop<T: Any>(t: T) {
- init {
- print("This is ${t::class.qualifiedName} \n")
- }
- }
- fun main(args: Array<String>) {
- val shop = Shop<Grocery>(Grocery()) // This is Grocery
- val shop2 = Shop(PaintShop())// This is PaintShop
- }
Add Comment
Please, Sign In to add comment