-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDay_13_switch.java
More file actions
33 lines (30 loc) · 969 Bytes
/
Copy pathDay_13_switch.java
File metadata and controls
33 lines (30 loc) · 969 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
28
29
30
31
32
33
package Programing.Section5;
public class Day_13_switch {
public static void main(String[] args) {
// int value = 2;
// if(value == 1){
// System.out.println(" value is 1");
// }
// else if(value==2){
// System.out.println("value is 2");
// }
// else{
// System.out.println(" value is not 1 or 2");
// }
int number = 4;
switch(number){
case 1:
System.out.println(" number is 1");
break;
case 2:
System.out.println("number is 2");
break;
case 3: case 4: case 5:
System.out.println(" number is either 3 or 4 or 5");
System.out.println(" Actually the number is: "+number);
break;
default:
System.out.println("number is not 1 ,2 ,3, 4 ,5");
}
}
}