What will be the output of the following Java program? [code] class exception_handling { static void throwexception()

What will be the output of the following Java program?
Code:
    class exception_handling 
    {
            static void throwexception() throws ArithmeticException 
            {        
                System.out.print("0");
                throw new ArithmeticException ("Exception");
            }
            public static void main(String args[]) 
            {
            try 
            {
                throwexception();
            }
            catch (ArithmeticException e) 
            {
                    System.out.println("A");
            }
        }
    }
A. A
B. 0
C. 0A
D. Exception
 

Tìm kiếm

Back
Top