开放大学在线学习搜题
当前位置:首页 > 学习题库 > C语言程序设计

问题

给出下面代码: public class Person{   static int arr[] = new int[10];   public static void main(String a[])   {    System.out.println(arr[1]);   } }

发布时间:2025-06-03   作者:国家开放大学   浏览:0

给出下面代码:

public class Person{

  static int arr[] = new int[10];

  public static void main(String a[])

  {

   System.out.println(arr[1]);

  }

}

那个语句是正确的?  )

A 编译时将产生错误;

B 编译时正确,运行时将产生错误;

C 输出零;

D 输出空。