问答题 定义一个新的类Student类,继承Person类。要求: 1)增加“school”属性为String类型。 2)重载Student类的构造方法,Student(String n,String l,String school)。 3)重写Person类的info()方法,增加school信息。
问答题 写出一个类People,并由该类做基类派生出子类Employee和Teacher。其中People 类具有name、age两个保护成员变量,分别为String类型、整型,且具有公有的getAge成员函数,用于返回age变量的值。Employee类具有保护成员变量empno为String类型,Teacher类有teano为String类型和zc成员变量为String类型。
问答题 Java中的方法重写(Overriding)和方法重载(Overloading)分别是什么?