Exceptions


  1. Which of these keywords must be used to handle the exception thrown by try block in some rational manner?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    If an exception occurs within the try block, it is thrown and cached by catch block for processing.


  1. Which of these keywords must be used to monitor for exceptions?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    try



  1. Which of these keywords is not a part of exception handling?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    Exceptional handling is managed via 5 keywords – try, catch, throws, throw and finally.


  1. When does Exceptions in Java arises in code sequence?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    Exceptions in Java are run-time errors.



  1. What is the output of this program?
    public class exception_Example
    {
    static void throwexception() throws ArithmeticException
    {
    System.out.print("50");
    throw new ArithmeticException ("Exception");
    }
    public static void main(String args[])
    {
    try
    {
    throwexception();
    }
    catch (ArithmeticException e)
    {
    System.out.println("M");
    }
    }
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    50M