//let apply with
senoirManager.let {
it.drive()
// println(this) this表示 該類的this指針 it表示該對象
println(it)
}
val applyResult = senoirManager.apply {
this.drive()
//apply返回的 是該對象
}
println("applyResult:$applyResult")
val withResult = with(senoirManager) {
this.drive()
//with 返回的是最後一行的值得
100
}
println("withResult:$withResult")
一張圖 說明之間的區別