콜렉션 Kotlin

1. listOf
val list = listOf("a","b","c")

2. mapOf
val map = mapOf("a" to 1, "b" to 2, "c" to 3)

println(map["key"])
map["key"]=value

for ((k,v) in map) {
  println("$k -> $v")
}

덧글

댓글 입력 영역