[OCAJP] 创建二维数组
Which two statements, when inserted independently at line // insert code here, enable the code to compile? A. int[][] arr = null; B. int[][] arr = new int[2]; C. int[][] arr = new int[2][]; D. int[][...
MagicLen · https://magiclen.org
本站也提供繁體中文版。切換到繁體中文版
分类
认证考试的考古题与模拟题解析,包含 Linux 认证(LPIC-1、LPIC-2)与 Java 认证(OCAJP、OCPJP),每一题都附上答案与详细的解说。
共 888 篇文章
Which two statements, when inserted independently at line // insert code here, enable the code to compile? A. int[][] arr = null; B. int[][] arr = new int[2]; C. int[][] arr = new int[2][]; D. int[][...
Which two statements are true? A. This is not the only valid for loop construct; there exits another form of for loop constructor. B. The expression expr1 is optional. it initializes the loop and is ...
Which option can replace xxx to enable the code to print 135? A. int e = 0; e <= 4; e++ B. int e = 0; e < 5; e += 2 C. int e = 1; e <= 5; e += 1 D. int e = 1; e < 5; e +=2
What is the output? A. X X X B. X Y X C. Y Y X D. Y Y Y
Which three members must have the private access modifier to ensure that this invariant is maintained? A. The x field B. The y field C. The sum field D. The ComputerSum ( ) constructor E. The setX ( ...
Which two statements are true? A. Requirements 1, 2, and 3 can be implemented by using the enhanced for loop. B. Requirements 1, 2, and 3 can be implemented by using the standard for loop. C. Require...
What is the result? A. 120 B. 120D C. A NumberFormatException will be thrown. D. Compilation fails due to error at line 5. E. Compilation tails due to error at line 8.
Which statement is true about the default constructor of a top-level class? A. It can take arguments. B. It has private access modifier in its declaration. C. It can be overloaded. D. The defaul...
Which statement is true about Java byte code? A. It can run on any platform. B. It can run on any platform only if it was compiled for that platform. C. It can run on any platform that has the Java R...
What is the result? A. 28false29 true B. 285 < 429 true C. true true D. compilation fails