package day02;
public class Person {
String name="fl";
}
class Car{
}
class Student extends Person{
String name="zl";
void show(){
System.out.println(super.name);}
}
class Test{
public static void main(String[] args) {
Student student = new Student();
student.show();
}
}
输出结果:f1
---------------------------
不使用super,或者把super改为this则输出zl