14 lines
302 B
Java
14 lines
302 B
Java
//: exceptions/ExceptionSilencer.java
|
|
|
|
public class ExceptionSilencer {
|
|
public static void main(String[] args) {
|
|
try {
|
|
throw new RuntimeException();
|
|
} finally {
|
|
// Using 'return' inside the finally block
|
|
// will silence any thrown exception.
|
|
return;
|
|
}
|
|
}
|
|
} ///:~
|