0
What the does MAP is? How does it work?
Can anyone explain me it in details?
2 Respostas
+ 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.
+ 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