可学答题网 > 问答 > SCJP程序员认证考试题库
目录: 标题| 题干| 答案| 搜索| 相关
问题

Given the following co


Given the following code:     public class Person{ static int arr[] = new int[10];  public static void main(String a[]) {     System.out.println(arr[1];)     }     }  Which statement is correct?()   

  • A When compilation some error will occur.
  • B It is correct when compilation but will cause error when running.
  • C The output is zero.
  • D The output is null.
参考答案
参考解析:

 int型数组是类对象,它在类被加载时完成初始化,在前面题目中已经有叙述,由于是原始数据类型int,其初始值为0。

分类:SCJP程序员认证考试题库
相关推荐

1、Given the following sc

Given the following scripts, both found in /usr/local/bin, what would the output be when exec...

2、Given the following in

Given the following interface definition, which definitions are valid?()  interface I {  vo...

3、Given the following co

Given the following code fragment:    public void create() {    Vector myVect;&en...

4、Given the following co

Given the following code:   public class Test { void printValue(int m){ do { System.out...

5、Given the following co

Given the following code, which code fragments, when inserted at the indicated location, will&ens...

6、Given the following co

Given the following code:    public class Person{    int arr[] = new int[10];&...