请问结果是什么,解释一下为什么?

古市轩 2011-03-16 07:54:03
class People
{
String name;
int age;
People()
{
}
People(String name,int age)
{
this.name=name;
this.age=age;
System.out.println("in people");
}
}

class Student extends People
{
String school;
Student()
{
this(null,0,null);
System.out.println("in student1");
}
Student(String name,int age,String school)
{
super(name,age);
this.school=school;
System.out.println("in student2");
}
}


class Graduate extends Student
{
Graduate()
{
System.out.println("in graduate");
}
}

class Exam3_16
{
public static void main(String [] args)
{
People p=new Graduate();
}
}

//请解释一下结果!
...全文
54 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

23,404

社区成员

发帖
与我相关
我的任务
社区描述
Java 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧