日期:2014-05-20 浏览次数:20661 次
public class Person {
private String name = "lucy";
private int age;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
public class Student extends Person {
public static void main(String[] args)
{
Student s =new Student();
System.out.println(s.getName());
}
}
结果是: lucy