The text below is selected, press Ctrl+C to copy to your clipboard. (⌘+C on Mac) No line numbers will be copied.
Guest
Q1
By Guest on 22nd November 2022 03:44:26 AM | Syntax: TEXT | Views: 6



New paste | Download | Show/Hide line no. | Copy text to clipboard
  1. /*Exceptional Handling */
  2. class Sudhir
  3. {
  4.     public static void main(String[] args)
  5.     {
  6.         try{
  7.             int a,b;
  8.             int c[];
  9.             c=new int[4];
  10.         a=0;
  11.         //b=45/a;
  12.         //System.out.println(b);
  13.         c[10]=8/a;
  14.         System.out.println(c[10]);
  15.         }
  16.     catch(ArrayIndexOutOfBoundsException visal)
  17.         {
  18.           System.out.println("Error "+visal);
  19.         }
  20.     catch(ArithmeticException faies)
  21.     {
  22.         System.out.println("Second catch error ");
  23.     }
  24.     }
  25. }



  • Recent Pastes