Check out example codes for "java 11 initialize map". It will help you in understanding the concepts better.

Code Example 1

Map<String, String> myMap = new HashMap<String, String>() {{
        put("a", "b");
        put("c", "d");
    }};

Code Example 2

Map<String, String> emptyMap = Map.of();
Map<String, String> singletonMap = Map.of("key1", "value");
Map<String, String> map = Map.of("key1","value1", "key2", "value2");

Learn ReactJs, React Native from akashmittal.com