Friday, March 6, 2015

Switch Statement in a java pgm



Free Flowing Switch Statement

public class FreeFlowingSwitchExample
{
 public static void main(String[] args)
{
int i=0;
switch(i)
{
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!");
   }
  }
}

No comments:

Post a Comment