1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
/* Java continue statement example. This example shows how to use java continue statement to skip the iteration of the loop. */ public class JavaContinueExample { public static void main(String[] args) { /* * Continue statement is used to skip a particular iteration of the loop */ int intArray[] = new int[]{1,2,3,4,5}; System.out.println("All numbers except for 3 are :"); for(int i=0; i < intArray.length; i++) { if(intArray[i] == 3) continue; else System.out.println(intArray[i]); } } } /* Output would be All numbers except for 3 are : 1 2 4 5 */ |
It’s a great site already::