1Map<String, String> myMap = new HashMap<String, String>() {{
2 put("a", "b");
3 put("c", "d");
4 }};
1//remember to first import java.util.*; first
2
3//you can swap out string or integer for other data types
4Map<String, Integer> d = new HashMap<>();
5
1 HashMap<Integer,String> map=new HashMap<Integer,String>();//Creating HashMap
2
1HashMap<Integer,String> map=new HashMap<Integer,String>();//key is integer, value is String