-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNestedSwitch.java
35 lines (33 loc) · 1.18 KB
/
NestedSwitch.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
34
35
import java.util.Scanner;
public class NestedSwitch {
public static void main(String[] args) {
Scanner input = new Scanner( System.in);
int EmpId = input.nextInt();
String Department = input.nextLine();
switch ( EmpId){
case 1 :
System.out.println(" Shoaib Mohammed");
break;
case 2 :
System.out.println(" Idman Abdirahman");
break;
case 3:
System.out.println(" Emp Num 3");
switch ( Department){
case "IT":
System.out.println(" Information R=Technology Department !");
break;
case " HR":
System.out.println(" Human Resources Department !");
break;
case "Mgt":
System.out.println(" Management Department !");
break;
default:
System.out.println(" No department entered");
}
default:
System.out.println(" Enter a correct EmpId");
}
}
}