Question: Consider the Java statement: int comparison = object 1 . compareTo ( object 2 ) ; where object 1 and object 2 both implement the

Consider the Java statement:
int comparison = object1.compareTo(object2);
where object1 and object2 both implement the Comparable interface. After this statement, the value stored in the variable comparison is 1. Assuming the compareTo method is written correctly, what can you say about the relation between the objects object1 and object2?
Group of answer choices
object1 and object2 are equal
object1 is less than object2
object1 is greater than object2
object1 and object2 point to the same object in memory

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 Databases Questions!