0
Why this print New A New B if in the main only is instancing obj?
class A { public A() { System.out.println("New A"); } } class B extends A { public B() { System.out.println("New B"); } } class Program { public static void main(String[ ] args) { B obj = new B(); } }
1 Answer