不能通过,不说private iont age;这个失误,只说构造函数Student(){this("haha")},当实例化对象时,如:Student stu=new Student(),在执行this("haha")这句话时,会进入一个死循环,this("haha")相当于Student("haha"),然后再执行 Student(String name) { this(); this.name = name; },再当执行到this()时又开始执行Student(){this("haha"); },以此往返形成死循环 |