|
SCJP Mock Exam Answers
A2)
Answer : A
BOOK234
PT652
VCD1464
Explanation :
Only Option A is correct. TreeMap is a sorted and ordered collection, which returns objects sorted on its keys. In this example code, the keys of TreeMap are objects of String class and the values are objects of ShoppingCartItem class. The class String implements the Comparable Interface, which enables TreeMap to sort its values on its keys.
<<<< Return to Q2 <<<<<
>>>> Go to Q3 >>>>
Submit your feedback on this mock exam
|