小蜜锋 - 云代码空间
—— 技术宅拯救世界!
pakage com.yqs.test class Milk { publcic Milk() { System.out.println ( "Constrator Milk be called!" ); } } class Bread { public Bread() { System.out.println ( "Constrator Bread be called!" ); } } class Apple { public Apple() { System.out.println ( "Constrator Apple be called!" ); } } class Orangle extends Apple { public Orangle() { System.out.println ( "Constrator Orangle be called!" ); } } class Water extends Orangle { public Water() { System.out.println ( "Constrator Water be called!" ); } } public class Test { Milk m = new Milk(); Water w = new Water(); Bread b = new Bread(); public Test() { System.out.println ( "Constrator Test be called!" ); } }