-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathj20SwitchCase.java
More file actions
38 lines (29 loc) · 1.04 KB
/
j20SwitchCase.java
File metadata and controls
38 lines (29 loc) · 1.04 KB
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
31
32
33
34
35
36
37
38
import java.util.Scanner;
public class j20SwitchCase {
public static void main (String[] args){
Scanner sc = new Scanner(System.in);
System.out.println("__Start with Switch Case__");
System.out.print("\nEnter a number between 1 to 5 : ");
int val = sc.nextInt();
// Switch case implementation
switch(val){
case 1:
System.out.println("First Block Executed");
break;
case 2:
System.out.println("Second Block Executed");
break;
case 3:
System.out.println("Third Block Executed");
break;
case 4:
System.out.println("fourth Block Executed");
break;
case 5:
System.out.println("fifth Block Executed");
break;
default:
System.out.println("When entered choice is other from Cases \"Choice Not Corect\"");
}
}
}