# Java maps
A map is a dictionary-like data structure.
A data structure stores data in properties and provides methods to operate ont the data.
A map stores entries which are pairs of keys and values just like in a dictionary where an entry is the pair "word" + "definition".
## Example
```java=
package co.simplon.sandbox;
public class Maps {
public static void main(String[] args) {
// On declare une variable map de type HashMap
// Cette HashMap est generique, on precise le type
// de la clef et le type de la valeur qu'elle peut gerer
HashMap<Integer, String> map = new HashMap<>();
// Insertion d'un couple clef/valeur avec map.put(clef, valeur)
map.put(Integer.valueOf(1), "Toto");
map.put(Integer.valueOf(2), "Tata");
// Recuperation d'une valeur par sa clef avec map.get(clef)
System.out.println(map.get(Integer.valueOf(1)));
System.out.println(map.get(Integer.valueOf(2)));
}
class Country {
private String name;
Country() {
}
public String getName() {
return name;
}
}
}
```