Exceptions
- Which of these keywords must be used to handle the exception thrown by try block in some rational manner?
-
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.
- Which of these keywords must be used to monitor for exceptions?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
try
- Which of these keywords is not a part of exception handling?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
Exceptional handling is managed via 5 keywords – try, catch, throws, throw and finally.
- When does Exceptions in Java arises in code sequence?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
Exceptions in Java are run-time errors.
- 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");
}
}
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
50M