This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
When creating an instance of a class first the class is initialized, then the constructor is called. In addition the constructions starts with the highest superclass and works its way down. Since you start your app with the code in the main method the line ClassC C = new ClassC(); Starts by loading ClassC and initializing its static variables (so now i=10). Then it walks up the heiracrchy till it finds the top class and starts initializing the super class A (nothing is printed), and calling the constructor for A. ClassA constructor10 is printed. Then the initialization for ClassC is done. j=50 and ClassB constructor50 is printed. Then the construcotr for ClassC is called. ClassC constructor is printed.
[This message has been edited by Cindy Glass (edited August 07, 2001).]
"JavaRanch, where the deer and the Certified play" - David O'Meara