Exception Handling Mcqs

Our collections of Multiple choice questions and answers focuses on study of Exception Handling in OOP. These questions are chosen from a collection of most authoritative and best reference books on OOP. Our aim is to prepare an individual for competitive exams like NTS, Web Developer | IOS Developer | Game Developer | Software House interviews and jobs, University and College entrance exams and various tests and job interviews. One should practice our Mcqs to assimilate Exception Handling in OOP comprehensively.

2.
Why do we need to handle exceptions?

To prevent abnormal termination of program

To encourage exception prone program

To avoid syntax errors

To save memory

4.
If a file that needs to be opened is not found in the target location then _____________

Exception will be produced

Exceptions are not produced

Exception might get produced because of syntax

Exceptions are not produced because of logic

6.
What are two exception classes in hierarchy of java exceptions class?

Runtime exceptions only

Compile time exceptions only

Runtime exceptions and other exceptions

Other exceptions

9.
Which among the following is not a method of Throwable class?

Public String getMessage()

Public Throwable getCause()

Public Char toString()

Public void printStackTrace()

10.
To catch the exceptions ___________________

An object must be created to catch the exception

A variable should be created to catch the exception

An array should be created to catch all the exceptions

A string have to be created to store the exception

11.
Multiple catch blocks __________________

Are mandatory for each try block

Can be combined into a single catch block

Are not possible for a try block

Can never be associated with a single try block

14.
Why do we use finally block?

To execute the block if exception occurred

To execute a code when exception is not occurred

To execute a code whenever required

To execute a code with each and every run of program

15.
Which among the following is true for class exceptions?

Only base class can give rise to exceptions

Only derived class can give rise to exceptions

Either base class or derived class may produce exceptions

Both base class and derived class may produce exceptions

0Shares
0
Scroll to Top