posted 23 years ago
Please explain : the answer for this when I run is 5 and 8. Thanks very much.
for(int i = 0; i<10; ++i) {
try { //outer try
if ( i % 3 == 0 ) throw new Exception("outer");
// inner try catch finally
try {
if ( i % 3 == 1) throw new Exception("inner");
System.out.println(i);
} catch (Exception inner) {
i*=2;
} finally {
++i;
} // end inner catch finally
} catch (Exception outer) { // catch outer
i +=3;
} finally {
++i;
} // end outer finally
} // end for