欢迎来到求知题库网 求知题库官网
logo
全部科目 > Java认证考试 > SCJP程序员认证考试

单项选择题

Given the uncompleted code of a class:    
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) { 
// doing the same as two arguments version of constructor    
// including assignment name=n,age=a    department = d;    
}    
} 
Which expression can be added at the "doing the same as..." part of the constructor?() 

    A. Person(n,a);
    B. this(Person(n,a));
    C. this(n,a);
    D. this(name,age);

点击查看答案&解析

相关考题

微信小程序免费搜题
微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题