Hi all, I am learning Kotlin with Samples. With the code following:
fun run() {
val run: () -> Unit = {
println("Run run run!")
}
// 新增一个 run 函数
fun run() = println("Hello World")
object : Runnable {
override fun run() = run()
}.run()
}
fun main(args: Array<String>) {
run()
}
Why the console print “Hello World” not “Run run run!” . Thanks!