Java程序设计 4道题求解 题目在图片上,qiu代码🙏🙏↓谢谢 已挂悬赏


class Student {
String name;
int ID;
Student(String name, int ID){
this.name = name;
this.ID = ID;
}
void print0() {
System.out.println(name + "," + ID);
}
}
class CollegeStudent extends Student{
String major;
CollegeStudent(String name, int ID, String major){
super(name, ID);
this.major = major;
}
void print0() {
super.print0();
System.out.println(major);
}
}
class Test{
public static void main(String[] args) {
CollegeStudent cs = new CollegeStudent("John", 101, "Computer Science");
cs.print0();
}
}