5、一种形式要更加安全些 136、继承时候类的执行顺序问题,一般都是选择题,问你将会打印出什么?答:父类:package test;public class FatherClass{ public FatherClass() { System.out.println("FatherClass Create"); }}子类:package test;import test.FatherClass;public class ChildClass extends FatherClass{ public ChildClass() { Sy
6、stem.out.println("ChildClass Create"); } public static void main(String[] args) { FatherClass fc = new FatherClass(); ChildClass cc = new ChildClass(); }}输出结果:C:>java test.ChildClassFatherClass CreateFatherClass CreateChildClass Create 137、内部类的实现方式?答:示例代码如下:package tes
7、t;public class OuterClass{ private class InterClass { public InterClass() { System.out.println("InterClass Create"); } } public OuterClass() { InterClass ic = new InterClass(); System.out.println("OuterClass Create"); } public static void main(String[] args) { Ou
8、terClass oc = new OuterClass(); }}输出结果:C:>java test/OuterClassInterClass CreateOuterClas