Created
March 20, 2019 10:45
-
-
Save alz-ahm/64963dab56969afd599faeb6abe36ed7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyClass(val listener: Listener) { | |
interface Listener { | |
fun doThis() | |
fun doThat(number: Int) | |
} | |
fun someFunction(){ | |
listener.doThis() | |
listener.doThat(12) | |
} | |
} | |
class UserClass { | |
val listener = object: MyClass.Listener { | |
override fun doThis() { | |
} | |
override fun doThat(number: Int) { | |
} | |
} | |
val myClass = MyClass(listener) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment