//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")
一张图 说明之间的区别