Sunday, December 5, 2010

Worry about Switch Statements in Java .................!!

No you don't need to worry i m here to help you out for Java ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,



class Switch {
public static void main(String args[]) {
for(int i=0; i<6; i++)
switch(i) {
case 0:
System.out.println("i is zero.");
break;
case 1:
System.out.println("i is one.");
break;
case 2:
System.out.println("i is two.");
break;
case 3:
System.out.println("i is three.");
break;
default:
System.out.println("i is greater than 3.");
}
}
}

No comments:

Post a Comment