
菜鸟中的菜鸟求助一道关于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. 展开
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. 展开
展开全部
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
}
}
{
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
}
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
你已经是菜鸟中的菜鸟中的精英的精英了,哈哈,我都看不懂那是什么。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询