Q:

Write a program in kotlin to map the following

belongs to collection: Kotlin programming Exercises

0

Write a program in kotlin to map the following 

Item 1, Item 2, Item 3, Item 4
22, 10, 12, 33

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Solution:

val map = mapOf(Pair("Item 1", 22), Pair("Item 2", 10), Pair("Item 3", 12), Pair("Item 4", 33))
println(map)

Output:

{Item 1=22, Item 2=10, Item 3=12, Item 4=33}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Write a program in Kotlin to replace is with was r... >>
<< Write a program in kotlin to differentiate between...