Q:

Java - Exception Handling(ArrayIndexOutOfBoundsException)

0

This Program is used to demonstrate ArrayIndexOutOfBoundsException concept.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

class arrex1

 {

   public static void main(String arg[])

    {

      try

        {

         int a[] = {2,4,6};

         System.out.println(a[5]);

        }

         catch(ArrayIndexOutOfBoundsException e)

          {   }

       finally

        {

          System.out.println("\nInvalide Array Value, change the value..."); 

        }

    }

 }

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now