Solved

Suppose Objects a and B Are from a User-Defined Class

Question 22

Multiple Choice

Suppose objects a and b are from a user-defined class that implements the Comparable interface.Which condition tests the compareTo method's return value to determine that a will precede b when the sort method is called?


A) a.compareTo(b) == -1
B) a.compareTo(b) < 0
C) a.compareTo(b) == 0
D) a.compareTo(b) > 0

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions