2019年5月20日 星期一

Kotlin學習筆記(7) Variables

Kotlin學習筆記(7)  Variables

fun main() {
var a: String = "initial"  // 1

val b: Int = 1             // 2
val c = 3 + 43             // 3 
    println(a)
    println(b)
    println(c)
 
}

輸出畫面
initial 1 46

  1. Declares a mutable variable and initializing it.
  2. Declares an immutable variable and initializing it.
  3. Declares an immutable variable and initializing it without specifying the type. The compiler infers the type Int.

沒有留言:

張貼留言

2024產專班 作業2 (純模擬)

2024產專班 作業2  (純模擬) 1) LED ON,OFF,TIMER,FLASH 模擬 (switch 控制) 2)RFID卡號模擬 (buttom  模擬RFID UID(不從ESP32) Node-Red 程式 [{"id":"d8886...