Skip to main content
2 of 3
deleted 81 characters in body
davewp
  • 111
  • 3
public class Main {  
  public static void main(String[] args) {
    new B();
  }

   static class A {       
        void foo() { 
            try {
                this.getClass().newInstance();
            } catch(Exception e) {
                e.printStackTrace();
            }
        }
    }
    

    static class B extends A {
        B() { foo(); }
        
        void foo() { super.foo(); }
    }
}
davewp
  • 111
  • 3