/home/wpollock1/public_html/Java/ConstuctorDemo.java
// Demo of order of constructor calls with inheritance.
//
// Written 11/2010 by Wayne Pollock, Tampa Florida USA
class Parent {
public Parent () {
System.out.println( "Parent no-arg constructor invoked.");
}
}
class Child extends Parent {
public Child () {
this(1);
System.out.println( "Child no-arg constructor invoked." );
}
public Child (int num) {
System.out.println( "Child int constructor invoked." );
}
}
public class ConstuctorDemo {
public static void main ( String [] args ) {
Child c = new Child();
}
}