Solved

Suppose You Wish to Sort an Array List of Objects

Question 92

Multiple Choice

Suppose you wish to sort an array list of objects, but the object class does not implement the Comparable interface.Because you are not allowed to modify this class, you decide to provide a comparator object that implements the Comparator interface.Which method must you implement from this interface to achieve your objective?


A) sort
B) compareObject
C) compare
D) compareTo

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