Created
October 10, 2019 07:53
-
-
Save laramartin/bcee718a4ce18ed2a132170a30bbe0d5 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 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