Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. sealed class SomeThing {
  2. abstract fun run()
  3. abstract fun play()
  4. }
  5.  
  6. class Thing1: SomeThing() {
  7. override fun run() = println("Run Fast!")
  8. override fun play() = println("Play Hard!")
  9. }
  10. class Thing2: SomeThing() {
  11. override fun run() = println("Run Silly!")
  12. override fun play() = println("Play Soft!")
  13. }
  14.  
  15. class NoThing {} // not part of the sealed class eh? no instantiation for you!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement