Ask Question
12 December, 06:16

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.

+4
Answers (1)
  1. 12 December, 08:51
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers