下列代码的编译或执行结果是( )。 public class Myval { public static void mai n (stri ng args[]){ MyVal m =ne w MyVal (); m.aMethod (); }

admin2012-12-02  64

问题 下列代码的编译或执行结果是(  )。
public class Myval {
public static void mai n (stri ng args[]){
  MyVal m =ne w MyVal ();
  m.aMethod ();

public void aMethod (){
  boolean b []=ne w Boolean [5];
  Syste m.out .pri ntln(b[0]);


选项 A、1
B、null
C、0
D、编译错误

答案A

解析 boolean 类型的变量值只有ture 或false ,b[0]的默认初始值为false。
转载请注明原文地址:https://jikaoti.com/ti/SbkiFFFM
0

相关试题推荐
最新回复(0)