A-A+
下列代码的编译或执行结果是()。 public class Myval{ public st
问题详情
下列代码的编译或执行结果是()。 public class Myval{ public static void main(string args[]){ MyVal m=new MyVal; aMethod; } public void aMethod{ boolean b[]=new Boolean[5]; System.OUt.println(b[0]); } }
A.1
B.null
C.0
D.编译错误请帮忙给出正确答案和分析,谢谢!
参考答案
正确答案:A
A。【解析】boolean类型的变量值只有ture或false,b[0]的默认初始值为false。