[Quote=引用 1 楼 justinavril 的回复:]
子类 myclass1= new 父类();
?????你那个什么老师啊
你编译一下下面这个代码:
Java codeclass Parent{
}
class Son extends Parent{
}
public class ParentAndSon{
public static void main(String args[]){
Son s = new Parent();
Parent p = new Son();
}
}
[/Quote]
不好意思,我上课在想**,看花了眼.谢谢大家帮忙解决.