title: How to refer to "this" in abstract Java class?
body: <p>Is it possible in Java to use <code>this</code> inside a method of an abstract class, but as an instance of the subclass at hand, not just of the abstract class?</p>
  
  <pre><code>abstract class MyAbstractClass &lt;MyImplementingClass extends MyAbstractClass&gt; {
  
      public abstract MyImplementingClass self();
  }
  </code></pre>
  
  <p>which I overwrite in every subclass I with </p>
  
  <pre><code>class MyImplementingClass extends MyAbstractClass&lt;MyImplementingClass&gt; {
  
      @Override public MyImplementingClass self() {
          return this;
      }
  }
  </code></pre>
  
  <p>but I wonder if there are more elegant methods to do this. In particular, one that doesn't require every subclass to overwrite a routine like <code>self()</code>.</p>