Exception Handling - Java Exam Multiple Choice Questions and Answers
Questions
1
Which of the following does not deal with exceptions?
Answer: Option [C]
finalize is a method and all other three are keywords. finalize() method is defined in java.lang.Object class. finalize() method is called to perform specific actions before Garbage collector reclaim the object.
2
URL throws an exception called
Answer: Option [D]
MalformedURLException thrown to indicate when a illegal URL has occured.
⭐ Make GKSeries Your Preferred Source on Google
Add GKSeries as Preferred Source
4
Which class is base class for all exceptions?
Answer: Option [C]
Throwbale class is in java.lang and it is the base class for all Exceptions
5
Java’s exception handling mechanism is meant to handle
Answer: Option [C]
Java’s exception handling mechanism handle errors such as divide integer by zero, ClassNotFound etc.