- 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;
- }
- }
- 下面的哪些表达式可以加到构造方法中的注释处? ( )
- A. Person(n,a);
- B. this(Person(n,a));
- C. this(n,a);
- D. this(name,age);
复制代码 |
|