单选题 阅读下列代码:
public class Person{
static int arr[]=new int[10];
public static void main(String args){
System.out.println(arr [9]);
}
}
该代码的运行结果是______。
【正确答案】 C
【答案解析】[解析] 若类的某个成员是基本数据类型,即使没有进行初始化,Java也会确保它获得一个默认值,如下表所示:
基本类型 默认值
boolean false
char ‘/u0000’(nun)
byte (byte)0
short (short)0
int 0
long 0L
float 0.0f
double 0.0d