In Java... The following catch statement can: catch (Exception e) {…} is an erro
ID: 3716389 • Letter: I
Question
In Java... The following catch statement can:
catch (Exception e) {…}
is an error since no objects are instantiated in the Exception class
handle all exceptions that are instances of the Exception class or a subclass of Exception
handle all throwable objects by using polymorphic reference as a parameter in the catch clause
handle all exceptions that are instances of the Exception class, but not a subclass of Exception
I've narrowed it down to option 2 or option 3...
is an error since no objects are instantiated in the Exception class
handle all exceptions that are instances of the Exception class or a subclass of Exception
handle all throwable objects by using polymorphic reference as a parameter in the catch clause
handle all exceptions that are instances of the Exception class, but not a subclass of Exception
Explanation / Answer
Option 2 is correct.
Explanation: Exception e can catch all types of exceptions, either the instance of Exception class or a subclass for example RuntimeException.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.