A-A+

给出下列的程序 其叙述正确的是 public class Man { static int

2022-08-06 02:34:45 问答库 阅读 174 次

问题详情

给出下列的程序,其叙述正确的是 public class Man { static int arr[ ] = new int[10]; public static void main(String a[ ] ) { System.out.println(arr[1] ); } }
A.编译时将发生错误
B.编译时正确但是运行时出错
C.输出为0
D.输出为null请帮忙给出正确答案和分析,谢谢!

参考答案

正确答案:C
解析:由于数组元素是整型,所以其初始值为0。

考点:程序