The following code segment has been created . What would be the output if we were to create a program and run it int[] a = {1,2,3,4,5}; try { for(int i = 0; i


The following code segment has been created . What would be the output if we were to create a program and run it

   int[] a = {1,2,3,4,5};
     try
      {
         for(int i = 0; i <= a.length;="">
            a[i]++;


       int ac = 10;


         int b = ac/0;
      }
    catch(ArrayIndexOutOfBoundsException e)
      {
      System.out.print( "Index out of bound ");
      }
     catch(Exception e)
     {
     System.out.print("division by zero ");
     }



Index out of bound



division by zero



index out of bound division by zero



Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here