Question: Fill in the most appropriate code in the blanks in the MyInt class? public class MyInt implements _ _ _ _ _ _ _ {

Fill in the most appropriate code in the blanks in the MyInt class?
public class MyInt implements _______{
int id;
public MyInt(int id){
this.id = id;
}
public String toString(){
return String.valueOf(id);
}
public int compareTo(_______ arg0){
if (id > arg0.id)
return 1;
else if (id < arg0.id)
return -1;
else
return 0;
}
}
a.
Comparable / MyInt
b.
Comparable / Object
c.
Comparable / MyInt
d.
Comparable / Object

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!