title: Java Abstract Class Implementing an Interface with Generics
body: <p>I am trying to define an abstract class implementing Comparable. When I define the class with following definition:</p>
  
  <pre><code>public abstract class MyClass implements Comparable &lt;MyClass&gt;
  </code></pre>
  
  <p>subclasses have to implement <code>compareTo(MyClass object)</code>. Instead, I want every subclass to implement <code>compareTo(SubClass object)</code>, accepting an object of its own type. When I try to define the abstract class with something like:</p>
  
  <pre><code>public abstract class MyClass implements Comparable &lt;? extends MyClass&gt;
  </code></pre>
  
  <p>It complains that "A supertype may not specify any wildcard."</p>
  
  <p>Is there a solution?</p>