本帖最后由 651012160 于 2013-12-23 08:08 编辑
请问下列代码执行后的结果是什么?并给我解释一下原理!谢谢{:soso__3110130392203091378_3:}
父类:
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();
}
}
|