Czy istnieje elegancki sposób obsługi wyjątków, które są wrzucane w finallybloku?
Na przykład:
try {
// Use the resource.
}
catch( Exception ex ) {
// Problem with the resource.
}
finally {
try{
resource.close();
}
catch( Exception ex ) {
// Could not close the resource?
}
}
Jak uniknąć try/ catchw finallybloku?