多项选择题
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.
相关考题
-
单项选择题
Itisdesirablethatacertainmethodwithinacertainclasscanonlybeaccessedbyclassesthataredefinedwithinthesamepackageastheclassofthemethod.Howcansuchrestrictionsbeenforced?()
A.Mark the method with the keyword public.
B.Mark the method with the keyword protected.
C.Mark the method with the keyword private.
D.Mark the method with the keyword package.
E.Do not mark the method with any accessibility modifiers. -
多项选择题
WhichofthesearekeywordsinJava?()
A.default
B.NULL
C.String
D.throws
E.long -
单项选择题
Which statements, when inserted at the indicated position in the following code, will cause a runtime exception when attempting to run the program?() class A {} class B extends A {} class C extends A {} public class Q3ae4 { public static void main(String args[]) { A x = new A(); B y = new B(); C z = new C(); // insert statement here } }
A.x = y;
B.z = x;
C.y = (B) x;
D.z = (C) y;
E.y = (A) y;
