
DADT03 Exception Handling
Authored by Izzati Safwanah
Information Technology (IT)
Professional Development
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
11 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the main purpose of exception handling in Java?
To ignore runtime errors
To terminate the program immediately
To handle runtime errors gracefully
To increase program performance
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a checked exception?
NullPointerException
IOException
ArithmeticException
ArrayIndexOutOfBoundsException
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the top-most class in the exception hierarchy in Java?
RuntimeException
Error
Exception
Throwable
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which keyword is used to handle exceptions in Java?
throw
catch
try
finally
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which keyword is used to explicitly raise an exception?
raise
throws
throw
error
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which method must be overridden when creating a custom exception class?
getCause()
toString()
getMessage()
None (optional override)
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In a try-with-resources statement, which interface must the resource implement?
AutoCloseable
Serializable
Runnable
CloseableOnly
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?