What is the result?

Given:

What is the result?

Given:

What is the result?

A.
John Adams
George Washington
Thomas Jefferson

B.
George Washington
John Adams
Thomas Jefferson

C.
Thomas Jefferson
John Adams
George Washington

D.
An exception is thrown at runtime

E.
Compilation fails

Explanation:
The program compiles and runs fine.
At runtime the NameList is built and then sorted by natural Order (String >> alphabetically).



Leave a Reply 1

Your email address will not be published. Required fields are marked *