[OCAJP][OCPJP]foreach 与数组对象参考
What is the result? A. 2 4 6 8 B. 2 4 6 8 9 C. 1 3 5 7 D. 1 3 5 7 9
MagicLen · https://magiclen.org
本站也提供繁體中文版。切換到繁體中文版
分类
认证考试的考古题与模拟题解析,包含 Linux 认证(LPIC-1、LPIC-2)与 Java 认证(OCAJP、OCPJP),每一题都附上答案与详细的解说。
共 888 篇文章
What is the result? A. 2 4 6 8 B. 2 4 6 8 9 C. 1 3 5 7 D. 1 3 5 7 9
What is the result? A. Hello Java! 8 Hello Java! 6 Hello Java! 4 B. Hello Java! 8 Hello Java! 6 C. Hello Java! 8 D. Compilation fails
Which statement is true? A. After line 8, three objects are eligible for garbage collection B. After line 8, two objects are eligible for garbage collection C. After line 8, one object is eligible fo...
What is the result? A. 12 B. Invalid Index 12 C. Invalid Index D. Compilation fails
What is printed out when the program is excuted? A. one B. two C. three D. four
Which set of commands prints Hello Duke in the console? A. javac Greeting java Greeting Duke B. javac Greeting.java Duke java Greeting C. javac Greeting.java java Greeting Duke D. javac Greeting.java...
What is the result? A. class java.lang.String class java.lang.String class java.util.ArrayList B. class java.lang.Object class java.lang. Object class java.util.Collection C. class java.lang.StringBu...
Which two statements are true for a two-dimensional array of primitive data type? A. It cannot contain elements of different types. B. The length of each dimension must be the same. C. At the declara...
Which three code fragments, when replaced individually for foo, enables the program to compile? A. int i : array B. int i = 0; i < 1; C. ; ; D. ; i < 1; i++ E. i = 0; i<1;
What is the result? A. square ... B. circle ... C. square circle ... D. Compilation fails.