black

Java认证考试综合练习

登录

单项选择题

以下代码运行的结果为()
public class Test{
public static void main (String[] args){
List<String> a = null;
test(a);
System.out.println(a.size());
}
public static void test(List<String> a){
a=new ArrayList<String>(); 
a.add(“abc”); 
} 
}

A.0
B.1
C.Java.lang.NullPointerException 
D.以上都不正确

相关考题

单项选择题 下面的两个输出结果为()public static void main(String[] args) {Integer f1=128,f2=128,f3=Integer.MIN_VALUE,f4=Integer.MIN_VALUE;System.out.println(f1==f2);System.out.println(f3==f4);}

单项选择题 下面的方法,当输入的i等于2时,方法返回值为()public static int getValue(int i) {int result = 0;switch(i++) {case 1:result = result + i;case 2:result = result + i * 2;case 3:result = result + i * 3;}return result;}

单项选择题 进栈顺序是ADEFGC,出栈顺序不可能是()

All Rights Reserved 版权所有©在线考试题库网(zxkao.com)

备案号:湘ICP备14005140号-7

经营许可证号:湘B2-20140064