-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNestedSwitch.java
More file actions
22 lines (21 loc) · 799 Bytes
/
NestedSwitch.java
File metadata and controls
22 lines (21 loc) · 799 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import java.util.Scanner;
public class NestedSwitch {
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("Satyam");
case 2 -> System.out.println("kumar");
case 3 -> {
System.out.println("Employee number 3 ");
switch (department) {
case "IT" -> System.out.println("IT Department");
case "Management" -> System.out.println("Management Department");
default -> System.out.println("Invalid Input");
}
}
default -> System.out.println("invalid input");
}
}
}