class Father
{
Father(){}
Fahter(int age)
{
System.out.println("father age:"+age);
}
}
class Son extends Father
{
Son()
{
//默认这里有一个东西 super();
//this(20);
System.out.println("son");
}
Son(int age)
{
super(age);
System.out.println("son age:"+age);
}
}
Son s = new Son(); //father;son
Son s = new Son(20);//father;son age:20
调用对象函数方法时,运行的步骤得到对应的结果的思路不是很明白??求讲解一下思路 |