java 基础题求解!在线等待!
import java.io.*;
class people{
String name;
int age;
people(){
System.out.println("In people1");
}
people(String name,int age){
this.name=name;
this.age=age;
System.out.println("In people2");
}
}
class student extends people{
String school;
student(){
//super();
this(null,0,null);
System.out.println("In student1");
}
student(String name,int age,String school){
super(name,age);
this.school=school;
System.out.println("In student2");
}
}
class gradute extends student{
String time;
gradute(){
this("a");
System.out.println("In gradute1");
}
gradute(String s){
this.time=s;
System.out.println("In gradute2");
}
}
public class Exam3_16{
public static void main(String args[]){
gradute d=new gradute();
}
}
请问以上程序的输出中为何没有"In people1"?
student(){
//super();
this(null,0,null);
System.out.println("In student1");
}
此构造方法不是隐含调用super()么?应该去调用people()才对!