OnJava8-Examples/reuse/Cartoon.java
Bruce Eckel 49edcc8b17 reorg
2015-06-15 17:47:35 -07:00

24 lines
526 B
Java

//: reuse/Cartoon.java
// ©2015 MindView LLC: see Copyright.txt
// Constructor calls during inheritance.
import static com.mindviewinc.util.Print.*;
class Art {
Art() { print("Art constructor"); }
}
class Drawing extends Art {
Drawing() { print("Drawing constructor"); }
}
public class Cartoon extends Drawing {
public Cartoon() { print("Cartoon constructor"); }
public static void main(String[] args) {
Cartoon x = new Cartoon();
}
} /* Output:
Art constructor
Drawing constructor
Cartoon constructor
*///:~