Home » JAVA Programming » Exceptions » Question
  1. What is the output of this program?
    public class ExceptionHandling_Example
    {
    static void throwexception() throws ArithmeticException
    {
    System.out.print("10");
    throw new ArithmeticException ("Exception");
    }
    public static void main(String args[])
    {
    try
    {
    throwexception();
    }
    catch (ArithmeticException e)
    {
    System.out.println("U");
    }
    }
    }
    1. 10U
    2. 10
    3. U
    4. U10
    5. None of these
Correct Option: A

10U



Your comments will be displayed only after manual approval.