Examveda
Examveda

What will be the output of the following Java program?
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

Answer: Option C


This Question Belongs to Java Program >> Interfaces And Abstract Classes

Join The Discussion

Related Questions on Interfaces and Abstract Classes

What is an interface in Java?

A. A contract specifying a set of methods that a class must implement

B. A class that cannot be instantiated

C. A class that contains only static methods

D. A subclass of the Object class