More inheritance and which method of which class is called
posted 8 months ago
Here is another interesting quesiton from
Glenn, Mitchell. OCAJP Oracle Certified Associate Java SE 8 Programmer Practice Exams (Kindle Locations 11610-11615). Enthuware. Kindle Edition.
Complete the following code by filling the two blanks -
Select 1 option A. XXX XXX
B. XXX YYY
C. YYY XXX
D. YYY YYY
I answered B for the simple reason that by doing when calling we called the overridden method of class YYY which doesn't throw an exception, but in fact it seems that that's not the case and the correct answer is D. Why?