class Person{
public Person(){
System.out.println(“this is a Person”);
}
}
public class Teacher extends Person{
private String name=”tom”;
public Teacher(){
System.out.println(“this is a teacher”);
super();
}
public static void main(String[] args){
Teacher teacher = new Teacher();
System.out.println(this.name);
}
}
结果输出是啥呀?为什么是他 |
|