精选优质文档-倾情为你奉上1. 定义一个Person类,含姓名、性别、年龄等字段;继承Person类设计Teacher类,增加职称、部门等字段;继承Person类设计Student类,增加学号、入学时间、专业等字段。定义各类的构造方法和toString()方法,并分别创建对象进行测试。package a.b.c;class personString name;char sex;int age;public person(String name,char sex,int age)this.name = name;this.sex = sex;this.age = age;class Student extends personString no;String enter;String major;public Student(String name,char sex,int age,String no,String enter,String major)