Kizspy Question: 42
(Choose 1 answer)
What is the output of the following code snippet?
Map<Character, Integer> map = new TreeMap();
String data "hello";
for (Character c: data.toCharArray()) {
if (map.containsKey(c)) {
map.put(c, map.get(c) + 1);
} else {
}
map.put(c, 0);
System.out.println(map.keySet());
A. ['e','h','','o']
B. ['h','o','e','l']
C. ['e','o', 'h','']
D. ['h','e','','o']