nerdexam
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

1Z0-804 question #36 exhibit

Options

  • AJohn Adams
  • BGeorge Washington
  • CThomas Jefferson
  • DAn exception is thrown at runtime
  • ECompilation fails

How the community answered

(58 responses)
  • A
    2% (1)
  • B
    83% (48)
  • C
    2% (1)
  • D
    3% (2)
  • E
    10% (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.

Full 1Z0-804 Practice