Java SE 11 Developer

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

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

Given:

Exam 1z0-819 Question 1

What is the result?

    Correct Answer: C

    The code initializes x to 0 and y to 6, and it evaluates the condition in the for loop where it increments x and decrements y each iteration. The loop continues as long as x is less than y. Inside the loop, there is a condition that checks if x is even using x%2==0, and if it is, it uses continue to skip the rest of the loop iteration. Therefore, the loop will skip printing any values when x is even. When x is 1 and y is 5, the condition x%2==0 is false, so it prints 1-5. The next possible time it would print is when x is 3 and y is 3, but x is no longer less than y, so the loop ends. Hence, the only output is 1-5.

Question 2 of 213

Given:

Exam 1z0-819 Question 2

What is the result?

    Correct Answer: D

    The given code is a loop structure with a do-while loop containing a for loop inside it. The variable 'i' is initially set to 10. In each iteration of the do-while loop, 'i' is divided by 2, and the resulting value is assigned to 'j'. The for loop prints 'j' until 'j' is greater than 0, decrementing 'j' with each iteration. After the for loop completes, 'i' is decremented by 2. This process continues until 'i' is no longer greater than 0. The sequence of prints will be: 5 4 3 2 1 (when i=10), 4 3 2 1 (when i=8), 3 2 1 (when i=6), 2 1 (when i=4), 1 (when i=2). Hence, the output will be '5 4 3 2 1 4 3 2 1 3 2 1 2 1 1'.

Question 3 of 213

Given:

Exam 1z0-819 Question 3

and

Exam 1z0-819 Question 3

Which two method definitions at line n1 in the Bar class compile? (Choose two.)

    Correct Answer: B, C

    To determine which methods compile, we need to consider Java's rules for method overriding and overloading. Option B defines a method in Bar with the same signature as the one in Foo, which means it properly overrides the method from Foo. Method overriding requires the exact same return type and parameter types. Option C defines a method with the same return type but different parameter types (TreeSet instead of Set), which is valid as overloading (since it's considered a different method due to the parameters). Thus, both B and C compile successfully.

Question 4 of 213

Given:

Exam 1z0-819 Question 4

What is the result?

    Correct Answer: B

Question 5 of 213

Given the code fragment:

Exam 1z0-819 Question 5

What is the result?

    Correct Answer: E

    The loop starts with i=0 and i < 10. At i=0, i % 5 is 0, so the default case is executed, which causes a break statement, and then i is printed and incremented to 1. When i=1, i % 5 is 1, case 1 is executed, incrementing i to 2 and then continues back to the beginning of the loop without printing. On i=2, i % 5 is 2, case 2 gets executed, which sets i to i *= 2 * i, resulting in i becoming 8, and then it breaks to print and increment i to 9. At i=9, i % 5 is 4, so case 4 is executed, incrementing i to 10 and then continues again back to the beginning, thus avoiding the print statement. Finally, the loop exits as i is now 10, and thus, only the numbers 0 and 8 are printed.