It is mentioned on page 556(exam watch) in K&B book, about sorting of collection and arrays, the elements should be mutuable comparable. What does this mean, i have created an object of Car and stored all same object of it into Object.
In class Car, i have not implemented any Comparable, or not a separate class with Comparator. Hence when i try to call Array.sort(objects).. it gives ClassCastException.
But when i implement one a Comparable interface, it works fine, does it mean that "if two objects elements are said to be mutually comparable in a collection (TreeSet) or in an array (Object), if they implement Comparable interface".