Page 876 - AP Computer Science A, 7th edition
P. 876
24. (A) While it is certainly possible to write a compareTo method for a Point class, there’s no good intuitive way to compare points. Two points (x1, y1) and (x2, y2) are equal if and only if x1 = x2 and y1 = y2. But if points P1 and P2 are not equal, what will determine if P1 < P2 or P1 > P2? You could try using the distance from the origin. Define P1 > P2 if and only if OP1 > OP2, and P1 < P2 if and only if OP1 < OP2, where O is (0,0). This definition means that points (a, b) and (b,a) are equal, which violates the definition of equals! The problem is that there is no way to map the two-dimensional set of points to a one- dimensional distance function and still be consistent with the definition of equals. The objects in each of the other classes can be compared without a problem. In choice B, two Name objects can be ordered alphabetically. In choice C, two Car objects can be ordered by year or by price. In choice D, two Student objects can be ordered by name or GPA. In choice E, two Employee objects can be ordered by name or seniority
(date of hire).