Skip to content

Instantly share code, notes, and snippets.

@laramartin
Created October 10, 2019 07:53
Show Gist options
  • Save laramartin/bcee718a4ce18ed2a132170a30bbe0d5 to your computer and use it in GitHub Desktop.
Save laramartin/bcee718a4ce18ed2a132170a30bbe0d5 to your computer and use it in GitHub Desktop.
class Manager {
var service: Service? = null
init {
service = Service(::print)
//service = Service({ message -> println(message) })
//service = Service { println(it) }
}
private fun print(message: String) {
println(message)
}
}
class Service(callMeMaybe: (String) -> Unit) {
init {
callMeMaybe.invoke("hello")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment