我常常說Kotlin 比Swift 舒服的一點是,Kotlin 在null-safety 問題上,會有所謂「smart cast」。例如你有. var a: Foo? = getFoo()nif (a != null) {n print(a.foo) ...
確定! 回上一頁