class Student{
    String name;
    static int lengthOfSchool=4;
    static int getLengthOfSchool() {
        return lengthOfSchool;
    }
}
class GraduateStudent extends Student {
    public String tutor;                                     
    public String spec_direction;                             
    static int lengthOfSchool = 3;
    static int getLengthOfSchool() {                          //方法重写
        return lengthOfSchool;
    }
}
class Example4_5{
    public static void main(String[] args) {
        GraduateStudent stu1 = new GraduateStudent();
        System.out.println("直接访问父类的学制： "+ Student.getLengthOfSchool());
        System.out.println("直接访问子类的学制： " + stu1.lengthOfSchool);
        System.out.println("调用子类的方法访问子类的学制：" + stu1.getLengthOfSchool());
    }
}
