多做题,通过考试没问题!

Java认证考试

睦霖题库>其他计算机考试>Java认证考试

Which two code fragments correctly create and initialize a static array of int elements?() 

  • A、 static final int[] a = { 100,200 };
  • B、 static final int[] a; static { a=new int[2]; a[0]=100; a[1]=200; }
  • C、 static final int[] a = new int[2] { 100,200 };
  • D、 static final int[] a; static void init() { a = new int[3]; a[0]=100; a[1]=200; }
正确答案:A,B
答案解析:
进入题库查看解析

微信扫一扫手机做题