-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMissingBreak.java
More file actions
39 lines (39 loc) · 899 Bytes
/
Copy pathMissingBreak.java
File metadata and controls
39 lines (39 loc) · 899 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
34
35
36
37
38
39
// break statement is optional
public class MissingBreak {
public static void main(String args[]){
for (int i = 0; i < 12; i++) {
switch(i){
case 0:
case 1:
case 2:
case 3:
case 4:
System.out.println("i is less then 5");
break;
case 5:
case 6:
case 7:
case 8:
case 9:
System.out.println("i is less then 10");
break;
default:
System.out.println("i is 10 and more");
}
}
}
}
/*
i is less then 5
i is less then 5
i is less then 5
i is less then 5
i is less then 5
i is less then 10
i is less then 10
i is less then 10
i is less then 10
i is less then 10
i is 10 and more
i is 10 and more
*/