Closed a-dminator closed 7 years ago
private fun foo(one: (String) -> Unit = {}, two: (String) -> Unit = {}) { one("one") two("two") }
fun main(args: Array) { foo({ print(it)} ) foo { print(it)} }
// What will it print? // a). oneone // b). twotwo // c). onetwo // d). Will not compile
A good one, thanks!
private fun foo(one: (String) -> Unit = {}, two: (String) -> Unit = {}) { one("one") two("two") }
fun main(args: Array) {
foo({ print(it)} )
foo { print(it)}
}
// What will it print? // a). oneone // b). twotwo // c). onetwo // d). Will not compile