exam questions

Exam 1z0-808 All Questions

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

Exam 1z0-808 topic 1 question 203 discussion

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

Given the code fragment:

What is the result?

  • A. EN FR JP
  • B. EN FR
  • C. CH
  • D. EN FR CH
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 months, 2 weeks ago
Selected Answer: B
Answer is B. To test: public static void main(String[] args) { List<String> Ist = Arrays.asList("EN", "FR", "CH", "JP"); Iterator<String> itr = Ist.iterator(); while(itr.hasNext()) { String e = itr.next(); if(e == "CH" ) { break; } System.out.println(e + " "); } }
upvoted 1 times
...
iSnover
3 months ago
Selected Answer: B
The answer is the letter B. It normally prints "EN" and "FR" and when it falls on the if, the break stops the while.
upvoted 1 times
...
shivkumarx
4 months ago
java variables can't begin with a number so this would not compile
upvoted 2 times
iSnover
3 months ago
You are correct, but pay attention, it's an "l" instead of "1" the number one has the tip of the head pulled more than the l. The code compiles.
upvoted 1 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