Home » JAVA Programming » Exceptions » Question
  1. What is the output of this program?
    public class Null_Pointer_Exception
    {
    public static void main(String args[])
    {
    try
    {
    System.out.print("First");
    throw new NullPointerException ("Interview Mania");
    }
    catch(ArithmeticException e)
    {
    System.out.print("Second");
    }
    }
    }
    1. First
    2. Second
    3. Interview Mania
    4. Compilation Error
    5. Runtime Error
Correct Option: E

FirstException in thread "main" java.lang.NullPointerException: Interview Mania
at Null_Pointer_Exception.main(Null_Pointer_Exception.java:8)



Your comments will be displayed only after manual approval.