Exceptions
- Which of these class is related to all the exceptions that can be caught by using catch?
-
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.
- Which of these class is related to all the exceptions that cannot be caught?
-
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.
- Which of these handles the exception when no catch is used?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
Default handler
- What exception thrown by parseInt() method?
-
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.
- 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");
}
}
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: E
Welcome to Interview Mania