Skip to content

Instantly share code, notes, and snippets.

@akexorcist
Last active March 30, 2020 16:59
Show Gist options
  • Select an option

  • Save akexorcist/f809849afc2a5da99179f4b531d8a962 to your computer and use it in GitHub Desktop.

Select an option

Save akexorcist/f809849afc2a5da99179f4b531d8a962 to your computer and use it in GitHub Desktop.
fun doSomething() {
...
doComplexTask("Akexorcist", { name ->
"Mr.${name.trim()}"
}, { fullName ->
System.out.println("Hello, $fullName")
})
}
fun doComplexTask(name: String,
method1: (name: String) -> String,
method2: (fullName: String) -> Unit) {
doSomething1(name)
method1(name)
doSomething2(name)
method2(name)
doSomething3(name)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment