Kotlin map1 [Kotlin] 코틀린 Map, Set 1. Map : Map은 key, value 형태로 key에 value를 매핑을 한다. 그래서 원하는 value를 검색할 때 key값으로 검색할 수가 있다. 리스트와 마찬가지로 mapOf()를 쓰거나 mutableMapOf()를 써서 만든다. var testMap1 = mutableMapOf() testMap1.put(5, "유리") testMap1.put(10, "철수") testMap1.put(15, "짱구") testMap1.put(20, "훈이") testMap1.put(20, "훈이") println(testMap1[5]) println(testMap1[20]) println("==================") println(testMap1.get(5)) println(testMap1.get.. 2022. 12. 27. 이전 1 다음