How do you initialize a map in Java?

We can also initialize the map using the double-brace syntax: Map<String, String> doubleBraceMap = new HashMap<String, String>() {{ put(“key1”, “value1”); put(“key2”, “value2”); }};

Sizin İçin Seçtik  What is staked OHM?

Leave a Reply

Your email address will not be published. Required fields are marked *

How do you initialize a map in Java?

We can also initialize the map using the double-brace syntax: Map<String, String> doubleBraceMap = new HashMap<String, String>() {{ put(“key1”, “value1”); put(“key2”, “value2”); }};

Sizin İçin Seçtik  How does Udemy promotion work?

Leave a Reply

Your email address will not be published. Required fields are marked *