title: Calling a parent's inner class in a super call Java
body: <p>So, I ran into a wall earlier. If I have a class Parent with an inner class SubParent like this:</p>
  
  <pre><code>public class Parent
  {
     public class SubParent
     {
     }
  
     public Parent(SubParent sp)
     {
     }
  }
  </code></pre>
  
  <p>Then I have a Child class which extends Parent like this:</p>
  
  <pre><code>public class Child extends Parent
  {
     public Child()
     {
        super(new SubParent());
     }
  }
  </code></pre>
  
  <p>Then I get a "error: cannot reference this before supertype constructor has been called" with an arrow pointing at the SubParent constructor.</p>
  
  <p>Now, if I have SubParent as a separate class in it's own file, everything is fine. But I would like to have it as an inner class.  Is there any way to do that?</p>