Consider the following Inheritance Hierarchy: Time left1:09:51 Fruit+abstract eat(); Apple +eat(); +make Pie(); Orange +squeeze(); +eat(); Golden
Fantastic news! We've Found the answer you've been seeking!
Question:
Consider the following Inheritance Hierarchy:
Time left 1:09:51
Fruit + abstract eat ();
Apple
+ eat ();
+ make Pie();
Orange
+ squeeze();
+ eat();
Golden
+ sell();
+ eat();
Macintosh
What is the result of the following code:
Fruit f1 = new Apple();
Apple a = (Apple) f1;
a. Results in an invalid cast exception
b. Compiles and Runs with no errors
C. Results in a compilation error
d. Result in a Runtime error
Related Book For
Financial Accounting and Reporting a Global Perspective
ISBN: 978-1408076866
4th edition
Authors: Michel Lebas, Herve Stolowy, Yuan Ding
Posted Date: