GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Java/Programs/SwitchCase.java at main · rochards/Java Expand file tree/ Copy pathSwitchCase.javaMore file actions 30 lines (30 loc) · 779 Bytes / Copy pathSwitchCase.javaFile metadata and controls30 lines (30 loc) · 779 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 // Program to demonstrate switch case statements in Java package switchCase; import java.util.Scanner; public class SwitchCase { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); System.out.println("Enter a number from 1 to 5: "); int num = sc.nextInt(); switch (num) { case 1: System.out.println("You have entered 1."); break; case 2: System.out.println("You have entered 2."); break; case 3: System.out.println("You have entered 3."); break; case 4: System.out.println("You have entered 4."); break; case 5: System.out.println("You have entered 5."); break; default: System.out.println("You have entered a number less than 1 or greater than 5."); } } } |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |