Guest User

Untitled

a guest
Sep 20th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. //Generic class
  2. class Grocery()
  3. class PaintShop()
  4.  
  5. class Shop<T: Any>(t: T) {
  6. init {
  7. print("This is ${t::class.qualifiedName} \n")
  8. }
  9. }
  10.  
  11. fun main(args: Array<String>) {
  12. val shop = Shop<Grocery>(Grocery()) // This is Grocery
  13. val shop2 = Shop(PaintShop())// This is PaintShop
  14. }
Add Comment
Please, Sign In to add comment