Answers for "using for each on a map 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

Browse Popular Code Answers by Language