nerdexam
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

1Z0-803 question #60 exhibit

Options

  • AZero
  • BOnce
  • CTwice
  • DThrice
  • ECompilation fails.

How the community answered

(34 responses)
  • B
    6% (2)
  • C
    15% (5)
  • D
    76% (26)
  • E
    3% (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.

Full 1Z0-803 Practice