class Person
{
String name;
Person(String name)
{
this.name = name;
}
}
class Student extends Person
{
Student(String name)
{
super(name);
this.name = "sas";
}
void show()
{
System.out.println(name);
}
}
class JiChengDemo
{
public static void main(String[] args)
{
Student s = new Student("sa");
System.out.println(s.name);
s.show();
}
}
怎么会出现提示错误呢? 望高手指点下 ,本人初学~ |