Exceptions


  1. Which of these class is related to all the exceptions that can be caught by using catch?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    Error class is related to java run time error that can’t be caught usually, RuntimeExecption is subclass of Exception class which contains all the exceptions that can be caught.


  1. Which of these class is related to all the exceptions that cannot be caught?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    Error class is related to java run time error that can’t be caught usually, RuntimeExecption is subclass of Exception class which contains all the exceptions that can be caught.



  1. Which of these handles the exception when no catch is used?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    Default handler


  1. What exception thrown by parseInt() method?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    parseInt() method parses input into integer. The exception thrown by this method is NumberFormatException.



  1. What is the output of this program?
    public class Exep_Handling_Example
    {
    public static void main(String args[])
    {
    try
    {
    int p, q;
    p = 0;
    q = 15/p;
    }
    catch(ArithmeticException e)
    {
    System.out.print("Welcome to ");
    }
    finally
    {
    System.out.print("Interview Mania");
    }
    }
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: E

    Welcome to Interview Mania