java - Difference between break and continue statement - Stack Overflow

java - Difference between break and continue statement - Stack Overflow

瀏覽:970
日期:2025-04-28
Consider the following: int n; for(n = 0; n < 10; ++n) { break; } System.out.println(n); break causes the loop to terminate and the value of n is 0. int n; for(n = 0; n < 10; ++n) { continue; } System.out.println(n); continue causes the program counter to...看更多