-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNestedSwitch.java
More file actions
27 lines (26 loc) · 939 Bytes
/
NestedSwitch.java
File metadata and controls
27 lines (26 loc) · 939 Bytes
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
class NestedSwitch{
public static void main(String[] args){
String Branch = "CSE";
int year = 2;
switch(year){
case 1:
System.out.println("Elective courses : Advanced English, Algebra");
break;
case 2:
switch(Branch){
case "CSE":
case "CSD":
System.out.println("Elective course : Big Data, Machine Learning");
break;
case "ECE":
System.out.println("Elective course : Antenna Engineering");
break;
default:
System.out.println("Elective course : Optimization");
}
break;
default:
System.out.println("No electives for 3rd and 4th year");
}
}
}