Question: IMMEDIATE. I'll upvote Assume there exist two classes named Base and Derived, such that Base is a subclass of Exception and Derived a subclass class.


IMMEDIATE. I'll upvote
Assume there exist two classes named Base and Derived, such that Base is a subclass of Exception and Derived a subclass class. What is the output of the following code? public class Example \{ public static void main(string[] args) 1 try \{ throw new Base (); catch (Derived b) \{ System.out.println ("Hey!"); catch (Exception d) \{ System.out.println("Hi!"); a. Hi ! b. Hey ! c. Code will cause a run time error d. Code has a compilation error
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
