Java / Exception
Can we keep other statements in between try, catch and finally blocks?
No, we cannot. They form a single unit.
try { // Statements that may raise exceptions } // No statement allowed here catch(Exception ex) { //Catching the exceptions here } // No statement allowed here finally { // This block is always executed }
More Related questions...