-
Notifications
You must be signed in to change notification settings - Fork 1
/
FlowQuiz.java
46 lines (35 loc) · 1.04 KB
/
FlowQuiz.java
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
40
41
42
43
44
45
46
import static java.lang.System.*;
class FlowQuiz {
public static void main(String... args) {
try {
for (int i : new int[]{ 2, 1, 3 })
switch (i) {
case 1:
for (int j = 1; j < 5; j++) {
out.println(j);
if (j == 3)
break;
}
break;
case 3:
for (int j = 1; j < 5; j++) {
if (j == 2)
return;
out.println(j);
}
case 2:
for (int j = 1; j < 5; j++) {
if (j == 2)
continue;
out.println(j);
}
default:
out.println("default");
}
out.println("done");
}
finally {
out.println("finally");
}
}
}