Quiz · Collections and generics · lesson 10 of 13
Quiz — put with the same key
Question 1 of 2
What does the program print?
import java.util.HashMap;
import java.util.Map;
public class Main {
public static void main(String[] args) {
Map<String, Integer> m = new HashMap<>();
m.put("a", 1);
m.put("a", 2);
System.out.println(m.get("a") + " " + m.size());
}
}