title: Returning subclass in an interface method
body: <p>I wanna make a linked list project in which I have created an interface and a class</p>
  
  <p>CLASS:</p>
  
  <pre><code>  public class MainNode&lt;T&gt; implements Node&lt;T&gt;
      {
          public T data;
          public MainNode&lt;T&gt; next;
          public MainNode&lt;T&gt; nextIs()
          {
              return next;
          }
      }.           //all other methods are defined and work fine
  </code></pre>
  
  <p>INTERFACE:</p>
  
  <pre><code>public interface Node&lt;T&gt;
  {
      public SUB_CLASS_RETURN_TYPE nextIs();
  }         //all other methods are declared as needed
  </code></pre>
  
  <p>Problem: the problem is that what should be written in SUB_CLASS_RETURN_TYPE to return the object or reference of derived/sub class</p>