- Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathDemo.java
More file actions
Latest commit
executable file
·53 lines (39 loc) · 1.13 KB
/
Copy pathDemo.java
File metadata and controls
executable file
·53 lines (39 loc) · 1.13 KB
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
47
48
49
50
51
52
53
packagetutorialquestions.question153d;
publicclassDemo {
publicstaticvoidmain(String[] args) {
try {
try {
try {
try {
switch (Integer.parseInt(args[0])) {
case0:
thrownewA();
case1:
thrownewB();
case2:
thrownewC();
default:
// Nothing.
}
} catch (Cexception) {
System.out.println(exception);
throwexception;
}
} catch (Bexception) {
System.out.println(exception);
throwexception;
}
} catch (Aexception) {
System.out.println(exception);
throwexception;
}
System.out.println("No exception was thrown.");
} catch (NumberFormatExceptionexception) {
System.out.println("The command-line argument you entered was not an integer!");
} catch (Exceptionexception) {
System.out.println("An exception was thrown: " + exception);
} finally {
System.out.println("All control-flow paths get to me!");
}
}
}