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:
Verified
Q64: You need to access values in objects
Q65: Which data structure would best be used
Q66: Assume that you have declared a map
Q67: Consider the following code snippet: Map<String, Integer>
Q68: You need to access values in the
Q70: Assume that you have declared a map
Q71: You want to enumerate all of the
Q72: You need to write a program to
Q73: You need to access values in the
Q74: Which of the following statements about manipulating
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents