Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sealed class SomeThing {
- abstract fun run()
- abstract fun play()
- }
- class Thing1: SomeThing() {
- override fun run() = println("Run Fast!")
- override fun play() = println("Play Hard!")
- }
- class Thing2: SomeThing() {
- override fun run() = println("Run Silly!")
- override fun play() = println("Play Soft!")
- }
- class NoThing {} // not part of the sealed class eh? no instantiation for you!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement