Java SE 7 Programmer I

Here you have the best Oracle 1z0-803 practice exam questions

  • You have 35 total questions to study from
  • Each page has 5 questions, making a total of 7 pages
  • You can navigate through the pages using the buttons at the bottom
  • This questions were last updated on May 13, 2025
  • This site is not affiliated with or endorsed by Oracle.
Question 1 of 35

Given the code fragment:

Exam 1z0-803 Question 1

What is the result?

    Correct Answer: D

Question 2 of 35

Given:

Exam 1z0-803 Question 2

What is the result?

    Correct Answer: A

    Within main, the local variable 'z' is assigned the value 6, which is then printed, leading to the output of 6. When 'doStuff()' is called, a new local variable 'z' is declared and assigned the value 5. The 'doStuff2()' method modifies the instance variable 'z' of the 'ScopeTest' class to 4. However, the local variable 'z' within 'doStuff()' remains 5, so the value 5 is printed next. Returning to 'main', the local 'z' still retains the value 6, which is printed once more. Lastly, 'myScope.z' is printed, which now holds the value 4 due to the 'doStuff2()' method. Thus, the final output is 6, 5, 6, 4.

Question 3 of 35

Given the code fragment:

Exam 1z0-803 Question 3

What is the result?

    Correct Answer: A

    The code first initializes the variable `b` to 4. The statement `b--` decreases the value of `b` by 1, changing it to 3. The statement `--b` is then executed, which decreases `b` by 1 again, changing it to 2, and this value is printed. Finally, the current value of `b`, which is now 2, is printed again. Therefore, the output is 2 and 2.

Question 4 of 35

Given the code fragment:

Exam 1z0-803 Question 4

What is the result?

    Correct Answer: C

    The first println statement, System.out.println(array[4][1]);, works fine. It selects the element with index 4, {0, 4, 8, 12, 16}, and from this array, it selects the element with index 1, which is 4. The second println statement, however, is written incorrectly. The correct syntax should be System.out.println(array[1][4]);. As written, it would cause a compilation error due to incorrect syntax. If corrected, it would also fail at runtime with an ArrayIndexOutOfBoundsException since array[1] has only 2 elements and accessing index 4 is out of bounds.

Question 5 of 35

Given:

Exam 1z0-803 Question 5

How many times is 2 printed as a part of the output?

    Correct Answer: A, B, C, D, E