exam questions

Exam 1z0-808 All Questions

View all questions & answers for the 1z0-808 exam

Exam 1z0-808 topic 1 question 151 discussion

Actual exam question from Oracle's 1z0-808
Question #: 151
Topic #: 1
[All 1z0-808 Questions]

Given the code fragment:

What is the result?

  • A. A B C Work done
  • B. A B C D Work done
  • C. A Work done
  • D. Compilation fails
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
carloswork
2 weeks, 6 days ago
Selected Answer: B
Answer is B. To test: public static void main(String[] args) { String[] arr = { "A", "B", "C", "D" }; for (int i = 0; i < arr.length; i++) { System.out.print(arr[i] + " "); if(arr[i].equals("D")) { System.out.println("Work done"); break; } continue; } }
upvoted 1 times
...
iSnover
2 months ago
Selected Answer: B
The correct answer is the letter D, notice that he printed the D before breaking. In the OCA exam they have questions where they change a variable or code letter to have a different answer, be careful not to memorize questions and mark them wrong in the tests, the secret is to understand how the code works to get right the questions that are variations of the code in question.
upvoted 1 times
iSnover
2 months ago
I wrote it wrong, I meant that the correct question is the letter B. I confused the letter B with D when explaining. Sorry.
upvoted 3 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago