What the does MAP is? How does it work? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What the does MAP is? How does it work?

Can anyone explain me it in details?

18th Jan 2017, 9:29 PM
Nochains
Nochains - avatar
2 Answers
+ 2
it's a key value pair. it just like you store a shoes into a box and then you named that box. so if you want to get the shoes you just find the box by its name. example : //you create list of boxes Map<String,String> boxes = new Hashmap<String,String>(); //put the shoes into one of your boxes //this time we calles it redbox boxes.put("redBox","shoes"); //get your shoes by its box name String myShoes = map.get("redBox"); remember you can only have one shoes in one box.
19th Jan 2017, 3:27 PM
Gusti Arya
Gusti Arya - avatar
+ 1
A map is a data structure. You can store a key to a value in it. You'll find more on google about hashmaps
18th Jan 2017, 11:10 PM
Jannick