Answers for "how to represent map entries in kotlin"

1

how to create map in kotlin

fun main(args: Array<String>){  
  
    val myMap = mapOf<Int,String>(1 to "Ajay", 4 to "Vijay", 3 to "Prakash")  
    for(key in myMap.keys){  
        println(myMap[key])  
    }  
}
Posted by: Guest on November-10-2021
2

make map kotlin

val map = mapOf(1 to "x", 2 to "y", -1 to "zz")
Posted by: Guest on September-14-2020

Code answers related to "how to represent map entries in kotlin"

Browse Popular Code Answers by Language