Vidyalelo
Java Programming · Q29

Exceptions

Programming · Java Programming · question 29

Q29

In Java, can a "catch" block catch exceptions of a subclass type before catching exceptions of a superclass type?

A.
Only if the superclass is marked as "static"
B.
Only if the subclass is marked as "final"
C.
Yes, a "catch" block can catch exceptions of a subclass type before a superclass type
Answer
D.
No, a "catch" block must catch exceptions of a superclass type first

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board