Multiple Try Catch Block example |
| Sanjay Verma replied to sudhakar subramaniyan at 05-Jul-08 05:35 |
try { int a[] =new int[6];
for(int i = 0; i<7; i++) { a[i]=i; } } catch (ArrayIndexOutOfBoundsException e) { out.println("Array index out of bounds."); } catch(ArithmeticException e) { out.println("Arithmetic exception: " + e); } catch(Exception e) { out.println("An error occurred: " + e); } |
| Biography |
| Asp.Net Developer |
|