-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswitch_code
34 lines (33 loc) · 1.07 KB
/
switch_code
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
import java.util.Scanner;
public class switch_code3 {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int empId =sc.nextInt();
String department=sc.next();
switch (empId) {
case 1:
System.out.println("kunal kushwaha");
break;
case 2:
System.out.println("Rahul Rana");
break;
case 3:
System.out.println("Emp Number 3");
switch (department) {
case "IT":
System.out.println("IT department");
break;
case "Management":
System.out.println("Management");
break;
default:
System.out.println("No department entered");
break;
}
break;
default:
System.out.println("please enter correct department ID");
break;
}
}
}