publicclassUndergraduateStudentextendsStudent{publicUndergraduateStudent(){
System.out.println("UndergraduateStudent()");}publicUndergraduateStudent(String name,int age){super(name, age);
System.out.println("UndergraduateStudent(name, age)");}publicstaticvoidprintDivisonLine(){
System.out.println("----------------------------------------------------------");}publicstaticvoidmain(String[] args){
Student s1 =newStudent();printDivisonLine();
Student s2 =newStudent("kimi",23);printDivisonLine();// first invoke the default constructor of the superclass and then invoke the default constructor of the subclass
Student s3 =newUndergraduateStudent();printDivisonLine();// first invoke the constructor of the superclass and then invoke the corresponding constructor of the subclass
Student s4 =newUndergraduateStudent("kimi",23);printDivisonLine();// first invoke the default constructor of the superclass and then invoke the default constructor of the subclass
UndergraduateStudent s5 =newUndergraduateStudent();printDivisonLine();// first invoke the constructor of the superclass and then invoke the corresponding constructor of the subclass
UndergraduateStudent s6 =newUndergraduateStudent("kimi",23);printDivisonLine();}}
public class Student{ private String name; private int age; public Student() { System.out.println("Student()"); } public Student(String name, int age) { System.ou...