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

Java认证考试

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

Which code fragments will succeed in initializing a two-dimensional array named tab with a size that will cause the expression tab[3][2] to access a valid element?()   CODE FRAGMENT a:  int[][] tab = {  { 0, 0, 0 },  { 0, 0, 0 }  };   CODE FRAGMENT b:  int tab[][] = new int[4][];  for (int i=0; i   CODE FRAGMENT c:  int tab[][] = {  0, 0, 0, 0,  0, 0, 0, 0,  0, 0, 0, 0,  0, 0, 0, 0  };   CODE FRAGMENT d:  int tab[3][2];   CODE FRAGMENT e:  int[] tab[] = { {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0} };  

  • A、Code fragment a.
  • B、Code fragment b.
  • C、Code fragment c.
  • D、Code fragment d.
  • E、Code fragment e.
正确答案:B,E
答案解析:
进入题库查看解析

微信扫一扫手机做题