FileDocCategorySizeDatePackage
InheritConstructor.javaAPI DocExample452Sat Nov 25 12:55:42 GMT 2000None

InheritConstructor.java

/** Show that if your class has no constructors, your superclass'
 * constructors still get called.
 */
public class InheritConstructor extends SomeOtherClass {
	public static void main(String[] c) {
		new InheritConstructor().run();
	}
	public void run() {
		System.out.println("In InheritConstructor::run");
	}
}

// This is the class that we extend.
class SomeOtherClass {
	SomeOtherClass() {
		System.out.println("In SomeOtherClass::<init>");
	}
}