Diagnose an inconsistent ordering

A developer tests a proposed natural ordering for three distinct objects. The following calls return the recorded integers:


Call

Result

X.compareTo(Y)

-3

Y.compareTo(X)

3

Y.compareTo(Z)

-2

Z.compareTo(Y)

2

X.compareTo(Z)

4

Z.compareTo(X)

-4


Every self-comparison returns zero. Select every statement supported by these observations.

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Comparable Questions: