class Person
{
int age;
Person(int age)
{
this.age = age;
//System.out.println(age);
}
}
class Student extends Person
{
Student(int age)
{
this.age = age;
System.out.println("age="+age);
}
}
class ExtendsDemo3
{
public static void main(String[] args)
{
Student s = new Student(30);
}
}
这段代码能编译通过吗,请教各位高手,知道的给详细解答一下,感谢! |
|