下列代码的执行结果是( )。
public class Test{
public int aMethod( ) {
static int i=0;
i+ +;
System.out.println(i);
}
public static void main(String args[ ]){
Test test = new Test( );
test.aMethod( );
}
}
题库:计算机等级考试
类型:最佳选择题
时间:2017-07-03 17:03:06
免费下载:《单选题》Word试卷
下列代码的执行结果是( )。
public class Test{
public int aMethod( ) {
static int i=0;
i+ +;
System.out.println(i);
}
public static void main(String args[ ]){
Test test = new Test( );
test.aMethod( );
}
}
A.构造方法名必须与类名一致
B.构造方法是给对象赋初值,所以没有返回值,且不用void来声明
C.构造方法一般不能由编程人员显示地直接调用,而是用new来调用
D.构造方法不可以被重载
本题关键词:行为结果,行为结果评价,结果,结果均,下果藤,行列式,危害结果,测定结果,结果期待,考评结果;