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

Click here to sign in and reply. You could earn money via our $500 contest just for being helpful.
  how to use multiple try catch block - sudhakar subramaniyan  05-Jul-08 05:19 5:19:23 AM
      try this... - Vasanthakumar D  05-Jul-08 05:31 5:31:34 AM
      See this - Sujit Patil  05-Jul-08 05:28 5:28:01 AM
      Multiple Try Catch Block example - Sanjay Verma  05-Jul-08 05:35 5:35:57 AM
      Re : how to use multile try catch block. - Ashutosh Dhok  05-Jul-08 06:22 6:22:07 AM
      Re : how to use multile try catch block. - Ashutosh Dhok  05-Jul-08 06:23 6:23:07 AM
      ans - Umapathy Kaliaperumal  05-Jul-08 06:34 6:34:53 AM
      Multiple try catch or nested try catch: - Chirag Bhavsar  05-Jul-08 08:52 8:52:08 AM
      reply - alice johnson  05-Jul-08 01:17 1:17:24 PM
View Posts