-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathNestedSwitchCase.java
33 lines (31 loc) · 1.05 KB
/
NestedSwitchCase.java
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
import java.util.Scanner;
public class NestedSwitchCase{
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int empId = in.nextInt();
String department = in.next();
switch (empId){
case 1:
System.out.println("Mohit Joshi");
break;
case 2:
System.out.println("Harishankar");
break;
case 3:
System.out.println("Employee Number 3");
switch(department){
case "EC":
System.out.println("EC Department");
break;
case "CS":
System.out.println("CS Department");
break;
default:
System.out.println("No department Entered");
}
break;
default:
System.out.println("Enter correct Employee Id");
}
}
}