1Map<String, String> myMap = new HashMap<String, String>() {{
2 put("a", "b");
3 put("c", "d");
4 }};
1Map<String, String> emptyMap = Map.of();
2Map<String, String> singletonMap = Map.of("key1", "value");
3Map<String, String> map = Map.of("key1","value1", "key2", "value2");
4
1public static Map<String, String> articleMapOne;
2static {
3 articleMapOne = new HashMap<>();
4 articleMapOne.put("ar01", "Intro to Map");
5 articleMapOne.put("ar02", "Some article");
6}