KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > SwitchStmtsSimple


1 public class SwitchStmtsSimple {
2     public static void main (String JavaDoc [] args) {
3         //for (int i = 0 ; i < 10; i++) {
4
int i = 7;
5         switch (i) {
6             
7                 case 2 : {
8                              System.out.println("Hello");
9                              break;
10                              }
11                 case 7 : {
12                                System.out.println("Hi");
13                                break;
14                              }
15                 default: {
16                             System.out.println("Smile");
17                             break;
18                          }
19             }
20                 
21         //}
22
}
23 }
24
Popular Tags