Q:

Write a program in kotlin to map the following

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)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now