Java OCA OCP Practice Question 1111

Question

Given the following code, what keyword must be used at line 4 in order to stop execution of the for loop?

1. boolean b = true; 
2. for (;;) { 
3.    if (b) { 
4.       <insert code> 
5.    } 
6. } 
  • A. stop
  • B. continue
  • C. break
  • D. None of the above


C.

Note

The break keyword is used to stop execution of a loop.




PreviousNext

Related