菜鸟中的菜鸟求助一道关于java继承的题目

实现一个超类person,制作两个类studentinstructor,这两个类可以从超类继承。一个person有名字和出生年份,一个student有主修科目(major... 实现一个超类person,制作两个类student instructor,这两个类可以从超类继承。一个person有名字和出生年份,一个student有主修科目(major),一个instructor有收入(salary). 为每一个类写一个构造器并且写一个分类定义。 并且写一个测试程序来测试每一个类和方法。

Implement a superclass Person. Make two classes, Student and Instructor, that inherit from
Person. A person has a name and a year of birth. A student has a major, and an instructor has
a salary. Write the class definitions and the constructors for all classes. Supply a test program
that tests these classes and methods.
展开
 我来答
riwcwt
2009-10-25 · 超过15用户采纳过TA的回答
知道答主
回答量:48
采纳率:0%
帮助的人:0
展开全部
class Person
{
String name=null;
int year;
Person(){};

}
class Student extends Person
{
String major;
Student(){};
}
class Instructor extends Person
{
int salary;
Instructor(){};
}
class Test
{
public void static main(String[] args)
{
//you can test here
}
}
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
百度网友d0bf0fc
2009-10-25 · TA获得超过228个赞
知道小有建树答主
回答量:269
采纳率:0%
帮助的人:105万
展开全部
你已经是菜鸟中的菜鸟中的精英的精英了,哈哈,我都看不懂那是什么。
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式