this 关键字的指向 — 程序设计判断题
题目
判断下列说法的正误:在 Java 中,构造方法内使用 this(参数列表) 可以调用本类的另一个构造方法,但该语句必须位于构造方法的第一行,因此以下代码能够正确编译并运行:
class Student {
String name;
Student() {
this("默认");
}
Student(String name) {
this();
this.name = name;
}
}