What is the output of the following code? class A { …
What is the output of the following code? class A { void foo() { System.out.println(“1”); } public A() { System.out.println(“2”); foo(); } } class B extends A { public B() { System.out.println(“3”); } void foo() { System.out.println(“4”); } } public class Client { public static void main(String [] args) { new B(); } }