Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

双冒号 :: 返回函数体

class Apply(){
    var name = "cao"
    var age = 12

    fun print(){
        println("name is $name,age is $age")
    }
    
}

fun main() {
    var app = Apply()
    app.apply {
        name = "zhang"
        age = 1
    }

    val print = app::print
    print()
}