Oracle
1Z0-804 · Question #36
Given: What is the result?
The correct answer is B. George Washington. The program compiles and runs fine. At runtime the NameList is built and then sorted by natural Order (String >> alphabetically).
Generics and Collections
Question
Given:
What is the result?
Exhibit
Options
- AJohn Adams
- BGeorge Washington
- CThomas Jefferson
- DAn exception is thrown at runtime
- ECompilation fails
How the community answered
(58 responses)- A2% (1)
- B83% (48)
- C2% (1)
- D3% (2)
- E10% (6)
Explanation
The program compiles and runs fine. At runtime the NameList is built and then sorted by natural Order (String >> alphabetically).
Topics
#Map#LinkedHashMap#get#insertion order
Community Discussion
No community discussion yet for this question.
