public class Person {
private static String name;
private static String sex;
private static int age;
Person(String name, int age) {
this.name = name;
this.age = age;
}
public void print() {
System.out.print("名字:" + name + " 性别:" + sex + " 年龄:" + age + " ");
}
}
public class Student extends Person {
private static String school;
private static String department;
private static String studentno;
Student(String name, int age, String school, String department,
String studentno) {
super(name, age);
this.school = school;
this.department = department;
this.studentno = studentno;
}
public void print() {
super.print();
System.out.println("学校是:" + school + " 系是:" + department + "
学号是:"
+ studentno);
}
}
本回答被提问者和网友采纳