Programming - Exception Handling
You Are Here :: Home > JAVA > Exception Handling - General Questions
7.
______________________ provides the means to separate the details of what to do when something out of the ordinary happens from the main logic of a program.
A.
Exceptions
B.
Assertion
C.
Abstraction
D.
Encapsulation
Answer: Option A
Explanation:
Exception provides the means to separate the details of what to do when something out of the ordinary happens from the main logic of a program.
8.
How many types of Exceptions are there?
A.
1
B.
2
C.
3
D.
more than 4
Answer: Option C
Explanation:
There are three types of Exceptions:1)Checked Exception 2) Unchecked Exception 3) Error
9.
_____________________________ are the exceptions which occur during the compile time of the program.
A.
Checked Exceptions
B.
UnChecked Exceptions
C.
both A and B
D.
none
Answer: Option A
Explanation:
Checked Exceptions are the exceptions which occur during the compile time of the program.
10.
The _____________________ checks at the compile time that whether the program contains handlers for checked exceptions or not.
A.
CPU
B.
Compiler
C.
Keyboard
D.
Executable Event
Answer: Option B
Explanation:
The compiler checks at the compile time that whether the program contains handlers for checked exceptions or not.
11.
Checked Exceptions do not extend RuntimeException class and must be handled to avoid a compile-time error by the programmer.
A.
Checked Exceptions
B.
UnChecked Exceptions
C.
both A and B
D.
none
Answer: Option A
Explanation:
Checked Exceptions do not extend RuntimeException class and must be handled to avoid a compile-time error by the programmer.
12.
Checked Exceptions extend the java.lang.Exception class
A.
Checked Exceptions
B.
UnChecked Exceptions
C.
both A and B
D.
none
Answer: Option A
Explanation:
Checked Exceptions extend the java.lang.Exception class
« prev
next »