Programming - Exception Handling
You Are Here :: Home > JAVA > Exception Handling - General Questions
25. |
The other way to handle an exception is using the ___________________ clause.
|
A. |
try |
B.
|
catch |
C.
|
Finally
|
D.
|
throws
|
|
Answer: Option D
Explanation:
The other way to handle an exception is using the throws clause. |
|
26. |
A _______________________________ is an exception that is typically a user error or a problem that cannot be foreseen by the programmer.
|
A. |
Checked Exceptions |
B.
|
UnChecked Exceptions |
C.
|
both A and B
|
D.
|
none
|
|
Answer: Option A
Explanation:
A checked exception is an exception that is typically a user error or a problem that cannot be foreseen by the programmer. |
|
27. |
A runtime exception is an exception that occurs that probably could have been avoided by the programmer.
|
A. |
Checked Exceptions |
B.
|
UnChecked Exceptions |
C.
|
Runtime Exception
|
D.
|
Compile Time Exception
|
|
Answer: Option C
Explanation:
A runtime exception is an exception that occurs that probably could have been avoided by the programmer. |
|
28. |
__________________ are typically ignored in your code because you can rarely do anything about an error.
|
A. |
Error |
B.
|
Message |
C.
|
Abstraction
|
D.
|
Encapsulation
|
|
Answer: Option A
Explanation:
Errors are typically ignored in your code because you can rarely do anything about an error. |
|
29. |
All exception classes are subtypes of the_______________________________ class.
|
A. |
java.io.Exception |
B.
|
java.lang.Exception |
C.
|
java.sql.Exception
|
D.
|
java.date.Exception
|
|
Answer: Option B
Explanation:
All exception classes are subtypes of the java.lang.Exception class. |
|
30. |
A ___________ block is placed around the code that might generate an exception.
|
A. |
try |
B.
|
catch |
C.
|
both A and B
|
D.
|
none
|
|
Answer: Option C
Explanation:
A try/catch block is placed around the code that might generate an exception. |
|
« prev
next »