Skip to content

Instantly share code, notes, and snippets.

@alz-ahm
Created March 20, 2019 10:45
Show Gist options
  • Save alz-ahm/64963dab56969afd599faeb6abe36ed7 to your computer and use it in GitHub Desktop.
Save alz-ahm/64963dab56969afd599faeb6abe36ed7 to your computer and use it in GitHub Desktop.
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