Java break and continue statements
class Test { public static void main(String[] args) { for (int i = 0; i < 10; i++) { System.out.println(“Value:” + i); if (i == 3) { break; // terminate the loop if condition is met } } System.out.println(“Code after the loop…”); } } Output: Value:0 Value:1 Value:2 Value:3 Code after the loop… In…
Read More Java break and continue statements