class Person {
String name, department;
int age;
public Person(String n){ name = n; }
public Person(String n, int a){ name = n; age = a; }
public Person(String n, String d, int a) {
// 完成Person(String n, int a)的逻辑
department = d;
}
}
下面的哪些表达式可以加到构造方法中的注释处? ( c )
A. Person(n,a);运行错误;
B. this(Person(n,a));// 运行错误;
C. this(n,a);// 运行正常
D. this(name,age); // 运行错误
谁能给讲讲我不是很懂 |
|