Oracle
1Z0-803 · Question #60
Given: How many times is 2 printed as a part of the output?
The correct answer is D. Thrice. The for statement, for (String ss: table), is executed one time for each of the three elements in table. The while loop will print a 2 once for each element.
Using Loop Constructs
Question
Given:
How many times is 2 printed as a part of the output?
Exhibit
Options
- AZero
- BOnce
- CTwice
- DThrice
- ECompilation fails.
How the community answered
(34 responses)- B6% (2)
- C15% (5)
- D76% (26)
- E3% (1)
Explanation
The for statement, for (String ss: table), is executed one time for each of the three elements in table. The while loop will print a 2 once for each element.
Topics
#loop constructs#nested loops#conditional statements#tracing
Community Discussion
No community discussion yet for this question.
