Oracle
1Z0-809 · Question #53
1Z0-809 Question #53: Real Exam Question with Answer & Explanation
The correct answer is C. e z b d. See the full explanation below for the reasoning.
Question
unSortMap.put (7, "e");
unSortMap.put (50, "m");
Map<Integer, String> treeMap = new TreeMap <Integer, String> (new Comparator<Integer> () {
@Override public int compare (Integer o1, Integer o2) {return
o2.compareTo(o1); } });
treeMap.putAll (unSortMap);
for (Map.Entry<Integer, String> entry : treeMap.entrySet ()) {
System.out.print (entry.getValue () + " ");
}
}
What is the result?
Options
- AA compilation error occurs.
- Bd b e j
- Ce z b d
- Dz b d e j
Community Discussion
No community discussion yet for this question.