2019年5月20日 星期一

Kotlin學習筆記(8) Declares a variable without initialization.

Kotlin學習筆記(8) Declares a variable without initialization.

fun main() {
 
    val d: Int   // 1
println(d) // 3
 
//d: Int  // 1
//println(e)  // 2
//Target platform: JVMRunning on kotlin v. 1.3.31
//Declares a variable without initialization.
//An attempt to use the variable causes a compiler error: Variable 'd' must be initialized.
 
}


Variable 'd' must be initialized
  1. Declares a variable without initialization.
  2. An attempt to use the variable causes a compiler error: Variable 'e' must be initialized.

沒有留言:

張貼留言

作業2 MQTT (Relay + DHT22) 控制 ------- 利用Node-Red

作業2 MQTT (Relay + DHT22) 控制 ------- 利用Node-Red 1) 安裝Node-Red  https://ithelp.ithome.com.tw/articles/10201795 https://www.youtube.com/watch?v...