1Z0-829 Controlling Program Flow • Set 3
1Z0-829 Controlling Program Flow Practice Test 3 — 15 questions with explanations. Free, no signup.
A developer is iterating over an array of sensor readings and needs to skip any reading whose value is negative while still processing the remaining readings. The loop is:
```java int[] readings = {5, -1, 8, -3, 2};
int total = 0;
for (int r : readings) {
if (r < 0) {continue;
}total += r;
}System.out.println(total); ```
What is printed?
Choose an answer to begin — your selection is scored in the full session.
15 questions · instant feedback and full explanations after every question.