1 class A{ 2 static int num = 1; 3 public static void Display(){ 4 System.out.println( num ); 5 } 6 } 7 8 class B extends A{ 9 static int num = 2; 10 public static void Display(){ 11 System.out.println( num ); 12 } 13 } 14 15 class C extends A{ 16 st
//: ORDER.CPP -- Order of constructor calls // with inheritance #include <iostream.h> #define inherit(derived, base) class derived : public base { public: derived() { cout << #derived << endl; } }; class X {}; inherit(A, X) inherit(B, A)