6.  To create our own exception class, we have to __________


Extend exception class
Create our own try and catch
use finally block
Use throws keyword


Answer

 Option

No answer description available for this question.

Workspace

Report
Mail id: Report Error:

Answer Workspace Report

7.  To explicitly throw an exception, ___________ keyword is used.


try
catch
throw
throwing


Answer

 Option

No answer description available for this question.

Workspace

Report
Mail id: Report Error:

Answer Workspace Report

8.  What happen in case of multiple catch blocks ?


Either super or subclass can be caught first
The superclass exception must be caught first
The superclass exception cannot caught first
None of these


Answer

 Option

No answer description available for this question.

Workspace

Report
Mail id: Report Error:

Answer Workspace Report

9.  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

10.  What is the output of the following program code ?
public class Test{
public static void main(String args[]){
try{
int i;
return;
}
catch(Exception e){
System.out.print(‘’inCatchBlock’’);
}
finally{
System.out.println(‘’inFinallyBlock’’);
}
}
}


inCatchBlock
inCatchBlockinFinallyBlock
inFinallyBlock
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