title: How to instantiate subclass from within a superclass
body: <p>What's wrong with the following code and how do I fix it? My objective is to work with a superclass in my <code>main</code> method. This superclass object is supposed to itself create (in its internal state) instances of its subclass. 
  The purpose of this is because the subclass only needs the state of the superclass to work with, and because all operations the subclass needs to do are only important as far as the superclass is concerned.</p>
  
  <pre><code>public class Test {
      public static void main(String[] args) {
          Test2 testSuperclass = new Test2("success #1");
      }   
  }
  
  class Test2 {
      public Test2(String printComment) {
          System.out.println(printComment);
          Test3 testSubclass = new Test3("success #2");
      }
  }
  
  class Test3 extends Test2 {
      public Test3(String printComment2) {
          System.out.println(printComment2);
      }
  }
  </code></pre>
  
  <p>The <code>Test3</code> constructor is generating the error <code>Implicit super constructor Test2() is undefined. Must explicitly invoke another constructor</code>.</p>