simple do while and switch demo
dowhileswitchdemo
/** * */ /** * @author arun * */ public class Switch { public static void main(String[] args) { int i = 2; do { System.out.println("simple do while and switch demo"); } while( i<2 || i>5); switch(i) { case 0: System.out.println("i is 0"); break; case 1: System.out.println("i is number 1"); break; case 2: System.out.println("i is number 2"); break; case 3: System.out.println("i is number 3"); break; case 4: System.out.println("i is number 4"); break; default: System.out.println("number is greater than 4"); } } } /* output simple do while and switch demo i is number 2 */
Please send comments to
vgdarur.javafive@blogger.com
Copyright © 2008 - iForeRunner.com
http://www.iforerunner.com/