可学答题网 > 问答 > SCJP程序员认证考试题库
目录: 标题| 题干| 答案| 搜索| 相关
问题

Which code fragments w


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} };  

  • ACode fragment a.
  • BCode fragment b.
  • CCode fragment c.
  • DCode fragment d.
  • ECode fragment e.
参考答案
参考解析:
分类:SCJP程序员认证考试题库
相关推荐

1、Which code fragment, i

Which code fragment, inserted at line 24, outputs "123abc 123abc"?()Asb1.append("abc"); s1.append("abc")...

2、Which code, inserted a

Which code, inserted at line 14, allows the Sprite class to compile?()ADirection d = NORTH...

3、Which code, inserted a

Which code, inserted at line 15, creates an instance of the Point class defined in Line...

4、Which code snippet, i

Which code snippet, inserted at line 8, causes the value Company to be output?()A JspWrite...

5、Which code, inserted a

Which code, inserted at line 15, allows the class Sprite to compile?()AFoo{public int bar(){r...

6、Which code, inserted a

Which code, inserted at line 4, guarantees that this program will output [1, 2]?()ASet se...