是否有一种优雅的方法来处理finally块中抛出的异常?
例如:
try {
// Use the resource.
}
catch( Exception ex ) {
// Problem with the resource.
}
finally {
try{
resource.close();
}
catch( Exception ex ) {
// Could not close the resource?
}
}
Run Code Online (Sandbox Code Playgroud)
你如何避免try/ catch在finally街区?