Question: Explain the output of the following code snippet: HashMap map = new HashMap (); map.put(LA, Los Angeles ); map.put(NJ, New Jersey); map.put(LA, Louisiana); map.put(NY,

Explain the output of the following code snippet: HashMap map = new HashMap (); map.put("LA", "Los Angeles" ); map.put("NJ", "New Jersey"); map.put("LA", "Louisiana"); map.put("NY", "New York"); System.out.println(map.get("LA")); System.out.println(map.size()); Use the editor to format your answer
Step by Step Solution
3.37 Rating (141 Votes )
There are 3 Steps involved in it
In the given code snippet a HashMap String String named map is created and initialized Keyvalue pair... View full answer
Get step-by-step solutions from verified subject matter experts
