List myList = myArray.asList();
List myList = Arrays.asList(myArray);
List myList = new ArrayList(myArray);
List myList = Collections.fromArray(myArray);
第1题:
A.数组myArray的长度已由6改为10,其中前6个元素的值不变,后四个元素的值为空。
B.数组myArray的长度已由6改为10,其中前6个元素的值不变,后四个元素需再经过初始化后才能使用。
C.数组myArray的长度已由6改为10,原来6个元素的值全部丢失。
D.数组myArray的长度没有变化。
第2题:
A.ListmyList=myArray.asList();
B.ListmyList=Arrays.asList(myArray);
C.ListmyList=newArrayList(myArray);
D.ListmyList=Collections.fromArray(myArray);
第3题:
下列的数组定义语句,不正确的是()
A、inta[]=newint[5]{1,2,3,4,5}
B、int[,]a=newinta[3][4]
C、int[][]a=newint[][4];
D、int[]a={1,2,3,4};
第4题:
下面是几条动态初始化二维数组的语句,指出其中正确的:
A、intarr5[][]=newint[4,5];
B、int[][]arr6=newint[4,5];
C、intarr7[,]=newint[4,5];
D、int[,]arr8=newint[4,5];
第5题:
A.Foo { public int bar() { return 1; }
B.new Foo { public int bar() { return 1; }
C.new Foo() { public int bar() { return 1; }
D.new class Foo { public int bar() { return 1; }
第6题:
以下程序执行的结果是什么?()int[]myArray=newint[3];try{for(inti=0;i<=myArray.length;i++){myArray[i]=i*3;System.out.println("myArray数组的第"+i+"个元素的值是:"+myArray[i]);}}catch(ArrayIndexOurOfBoubsExceptione){System.out.println("数组下标越界");}
A.程序执行,屏幕上显示“数组下标越界”
B.程序出现异常,屏幕上提示出现数组下标越界异常
C.程序正常执行结束,屏幕上显示数组中每个元素的值
D.程序编译出错
第7题:
A.int[]score=newint[5]{1,2,3,4,5};
B.int[5]score=newint[]{1,2,3,4,5};
C.intscore={1,2,3,4,5};
D.int[]score=newint[5];
第8题:
在C#中,()正确定义了一个具有10个int类型的数组。
A、intiArray=newint[10];
B、int[]iArray=newint;
C、int[]iArray=newint(10);
D、int[]iArray=newint[10];
第9题:
A.Compilationfailsbecauseofanerrorinline13.
B.AClassCastExceptionisthrownatruntime.
C.123
D.Compilationfailsbecauseofanerrorinline14.
E.Compilationfailsbecauseofanerrorinline12.
第10题:
int[][] myarray3=new int[3][]{new int[3]{5,6,2},new int[5]{6,9,7,8,3},new
int[2]{3,2}};myarray3[2][2]的值是( )。