21.  What is the output of following try catch block
try
{
int i;
return;
}
catch(Exception e)
{
System.out.println(‘’Hello India’’);
}
finally
{
System.out.println(‘’Hello Morbi’’);
}


Hello India
Hello India
Hello Morbi

Hello Morbi
The program will return without printing anything


Answer

 Option

No answer description available for this question.

Workspace

Report
Mail id: Report Error:

Answer Workspace Report

22.  Which of the following must be true of the object thrown by a throw statement ?


It must be assignable to the Throwable type
It must be assigned to the Error type
It must be assigned to the Exception type
It must be assignable to the String type


Answer

 Option

No answer description available for this question.

Workspace

Report
Mail id: Report Error:

Answer Workspace Report

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


try
finally
throw
catch


Answer

 Option

No answer description available for this question.

Workspace

Report
Mail id: Report Error:

Answer Workspace Report

24.  Which of these keywords is used to manually throw an exception ?


try
finally
throw
catch


Answer

 Option

No answer description available for this question.

Workspace

Report
Mail id: Report Error:

Answer Workspace Report

25.  What is the output of this program ?
class exception_handling {
public static void main(String args[]) {
try {
int a, b;
b = 0;
a = 5 / b;
System.out.print(‘’A’’);
}
catch(ArithmeticException e) {
System.out.print(‘’B’’);
}
}
}


A
B
Compilation Error
Runtime Error


Answer

 Option

No answer description available for this question.

Workspace

Report
Mail id: Report Error:

Answer Workspace Report