Java examples for Language Basics:continue
Uses a continue statement to skip the number 12 rather than stop counting altogether when it reaches 12:
public class Main { public static void main(String[] args) {// w w w. jav a2 s .co m int number = 0; while (number < 20) { number += 2; if (number == 12) continue; System.out.print(number + " "); } System.out.println(); } }