Can an interface implement another interface? Is the following a suitable implementation of the Comparable interface? public class Double2 implements Comparable { private double value; public...



Can an interface implement another interface?



Is the following a suitable implementation of the Comparable interface?


public class Double2 implements Comparable


{



private double value;



public Double2(double theValue)



{



value = theValue;



}



public int compareTo(Object other)



{



return -1;



}



public double doubleValue()



{



return value;



}


}


You can think of the underlying “comes before” relationship as saying that for


any objects d1 and d2, d1 comes before d2.



May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here