Questions from the sample questions by CB - CompSci

<p>

</p>

<p>Why is II wrong? (Answer is A)</p>

<p>As far as I know, when you implement methods defined in an interface, the return type must match (III is wrong) and the parameter type must match (II is wrong). Hope that helps!</p>

<p>The Comparable interface provides a comparison mechanism for any object. </p>

<p>My guess is that you can’t put in the formal parameters Someclass because Someclass is not related to all other classes in the Java API. Object is at the top of the hierarchy, so you can say that any object is-a Object, but you can’t say that any object is-a Someclass.</p>

<p>Also, the return type and formal parameters must match that of the interface.</p>