single try multiple catch

PHOTO EMBED

Tue Jan 16 2024 10:25:42 GMT+0000 (Coordinated Universal Time)

Saved by @E23CSEU1151 #java

class F
{
    public static void main(String[] args){
        try
        {
            int a=10 , b=0 , c;
            c=a+b;
            System.out.println(c);
            
            int d[]={10,20};
            System.out.println(d[1]);
            
            String j = "amkit";
            System.out.println(j.toUpperCase());
           
        }
        catch(ArrayIndexOutOfBoundsException d)
        {
            System.out.println("array error");
        }
        catch(ArithmeticException F)
        {
           System.out.println("ap error");
        }
        catch(NumberFormatException o)
        {
            System.out.println("number format error");
        }
        catch(Exception L)
        {
            System.out.println("some basic error ");
        }
    }
}
content_copyCOPY