Ask Question
19 September, 05:14

Suppose a developer gets class XYZ files and documentation from a subcontractor. This class does not implement the Comparable interface. What must be true in order for the developer to sort an array of XYZ objects without modifying the xyz class? a. The developer must supply a comparator object belonging to a class that implements the Comparator interface. b. XYZ objects must be randomly distributed. c. The XYZ class must implement the Sortable interface. d. XYZ objects must be ordered.

+5
Answers (1)
  1. 19 September, 08:59
    0
    A) The developer must supply a comparator object belonging to a class that implements the Comparator interface

    Explanation:

    The comparator interface handles the ordering (sorting) of user-defined classes, it does this by comparing two different objects from different classes. The comparator interface works by accepting a method which extracts a key for sorting of a type say N, and returns a comparator that compares to N, it therefore compares the object (current one) with the specified one
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Suppose a developer gets class XYZ files and documentation from a subcontractor. This class does not implement the Comparable interface. ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers