【单选题】Analyze the following code: public class Test { public static void main(String[] args) { int[] x = new int[5]; int i; for (i = 0; i < x.length; i++) x[i]=i; System.out.println(x[i]); } }
A.
The program has a runtime error because the last statement in the main method causes ArrayIndexOutOfBoundsException.
B.
The program displays 4.
C.
The program has a compile error because i is not defined in the last statement in the main method.
D.
The program displays 0 1 2 3 4.
【单选题】阅读代码,判断输出结果是() public class MyCall{ public static void main(String[] args){ int[] number = new int[5]; for(int i= 0;i<3;i++){ number[i]=i; } for(int i=0;i
【单选题】public class Alpha{ private static Character() ids; public static void main( String[] args){ ids = new Character[args.length]; for (int i=0; i ids[i] = new Character( args[i] ); System.out.print(...
B.
The code runs with no output.
C.
An exception is thrown at runtime.
D.
The code runs, outputing a concatenated list of the arguments passed to the program.
【简答题】阅读下列代码public class Arrays{ public static void main(String[] args){ int[] a=new int[5]; for(int i=0;iA.1011121314MikeBobFrankJim B.1112131415FrankBobMikeJim C.1011121314FrankBobJimMike D.1112131...
【单选题】分析以下代码: public class Test { public static void main(String[] args) { int[] x = new int[5]; int i; for (i = 0; i < x.length; i++) x[i]=i; System.out.println(x[i]); } }
C.
程序出现运行时错误,因为main方法中的最后一条语句导致ArrayIndexOutOfBoundsException。
D.
该程序有一个编译错误,因为在main方法的最后一条语句中未定义i。
【单选题】劈尖等厚干涉某一级干涉条纹发生弯曲,偏向上一级干涉条纹,那么玻璃板内下表面部分()