<code>for (int i = 0; i < 5; i++) {} System.out.println(i);</code> will
- A
Print 0
- Bcheck_circle
Compile error: i out of scope
- C
Print 5
- D
Print 4
Explanation
<code>i</code> declared inside <code>for</code> is scoped to the loop only.
AP Computer Science A· difficulty 4/5
<code>for (int i = 0; i < 5; i++) {} System.out.println(i);</code> will
Print 0
Compile error: i out of scope
Print 5
Print 4
Explanation
<code>i</code> declared inside <code>for</code> is scoped to the loop only.
Want 10 more like this — adaptive to your weak spots?