-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAlwaysFinally.java
More file actions
22 lines (20 loc) · 545 Bytes
/
AlwaysFinally.java
File metadata and controls
22 lines (20 loc) · 545 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package chapter12;
import static net.mindview.util.Print.*;
class FourException extends Exception{}
public class AlwaysFinally {
public static void main(String[] args) {
print("Entering first try block");
try {
print("Entering second try block");
try {
throw new FourException();
} finally {
print("finally in 2nd try block");
}
} catch (FourException e) {
System.out.println("Caught FourException in 1st try block");
}finally{
System.out.println("finally in 1st try block");
}
}
}