Java examples for Language Basics:switch
Free Flowing Switch Statement
public class Main { public static void main(String[] args) { int i=0; switch(i) {//from w w w .j av a 2 s .c o m case 0: System.out.println("i is 0"); case 1: System.out.println("i is 1"); case 2: System.out.println("i is 2"); default: System.out.println("Free flowing switch example!"); } } }