15
melempar Exception pada blok terakhir
Adakah cara elegan untuk menangani pengecualian yang dilanggar finally? Sebagai contoh: try { // Use the resource. } catch( Exception ex ) { // Problem with the resource. } finally { try{ resource.close(); } catch( Exception ex ) { // Could not close the resource? } } Bagaimana Anda menghindari …