问答题

简答题

定义一个新的类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)分别是什么?
相关试题
  • MultipartFile接口的()方法用来判断上传...
  • 文件解析器类CommonsMultipartResolver的(...
  • 当客户端form表单的enctype属性为()时,...
  • 文件上传时,form表单的method属性设置为(...
  • <mvc:interceptors>元素用于配置一组拦...