Given:
3. public class Main { 4. public static void main(String[] args) { 5. int[] ia = {1,3,5,7,9}; 6. for(int x : ia) { 7. for(int j = 0; j < 3; j++) { 8. if(x > 4 && x < 8) continue; 9. System.out.print(" " + x); 10. if(j == 1) break; 11. continue; 12. }//w ww .j av a 2 s . co m 13. continue; 14. } 15. } 16. }
What is the result?
D is correct.
For unlabeled continue statements, the current iteration stops early and execution jumps to the next iteration.
The last two continue statements are redundant!