
一道Java的英文题,不会做,请高手指点,还有一个数组的~~
Whatwillbetheresultofattemptingtocompileandrunthefollowingcode?abstractclassMineBase{...
What will be the result of attempting to compile and run the following code?
abstract class MineBase { abstract void amethod(); static int i;}public class Mine extends MineBase { public static void main(String argv[]){ int[] ar=new int[5]; for(i=0;i < ar.length;i++) System.out.println(ar[i]); }}
1) a sequence of 5 0's will be printed
2) Error: ar is used before it is initialized
3) Error Mine must be declared abstract
4) IndexOutOfBoundes Error
下面哪个语句是创建数组的正确语句?
A、 float f[][] = new float[6][6];
B、float []f[] = new float[6][6];
C、float f[][] = new float[][6];
D、float [][]f = new float[6][6];
E、float [][]f = new float[6][];
答案是什么,能否详细解释一下~ 展开
abstract class MineBase { abstract void amethod(); static int i;}public class Mine extends MineBase { public static void main(String argv[]){ int[] ar=new int[5]; for(i=0;i < ar.length;i++) System.out.println(ar[i]); }}
1) a sequence of 5 0's will be printed
2) Error: ar is used before it is initialized
3) Error Mine must be declared abstract
4) IndexOutOfBoundes Error
下面哪个语句是创建数组的正确语句?
A、 float f[][] = new float[6][6];
B、float []f[] = new float[6][6];
C、float f[][] = new float[][6];
D、float [][]f = new float[6][6];
E、float [][]f = new float[6][];
答案是什么,能否详细解释一下~ 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询