-->
当前位置:首页 > 题库

单选题:对以下程序进行编译、运行结果是

Luz5年前 (2021-05-10)题库2215
对以下程序进行编译、运行结果是 @[C](2)
```
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]);
   }
  }

```


A. 打印5个0。
B. 编译出错,数组ar[]必须初始化。
C. 编译出错。
D. 出现IndexOutOfBoundes的异常




A.打印5个0。
B.编译出错,数组ar[]必须初始化。
C.编译出错。
D.出现IndexOutOfBoundes的异常


答案:C