Solved

You Have Decided to Store Objects of a Class in a TreeSet

Question 69

Multiple Choice

You have decided to store objects of a class in a TreeSet structure. Which of the following statements is correct?


A) If the object class implements the Comparable interface, and the sort order in the compare method is acceptable, you do not have to do anything else.
B) If the object class implements the Comparable interface, and the sort order in the compareTo method is acceptable, you do not have to do anything else.
C) If the object class implements the Comparable interface, and the sort order in the compare method is acceptable, you must create a comparator object.
D) If the object class implements the Comparable interface, and the sort order in the compareTo method is acceptable, you must create a comparator object.

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents