ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
# 1-11.继承时候类的执行顺序问题,一般都是选择题,问你将会打印出什么? ``` 答:父类: package test; public class FatherClass { public FatherClass() { System.out.println("FatherClass Create"); } } 子类: package test; import test.FatherClass; public class ChildClass extends FatherClass { public ChildClass() { System.out.println("ChildClass Create"); } public static void main(String[] args) { FatherClass fc = new FatherClass(); ChildClass cc = new ChildClass(); } } 输出结果: C:>java test.ChildClass FatherClass Create FatherClass Create ChildClass Create ```