Question: Suppose objects a and b are from a user - defined class that implements the Comparable interface. Which condition tests the compareTo method s return

Suppose objects a and b are from a user-defined class that implements the Comparable interface. Which condition tests the compareTo methods return value to determine that a will precede b when the sort method is called?
Group of answer choices
a.compareTo(b)==-1
a.compareTo(b)>0
a.compareTo(b)<0
a.compareTo(b)==0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!