What will this program output? 2 What will be printed by the following code? Con
ID: 3744000 • Letter: W
Question
What will this program output?
Explanation / Answer
The output contains 3 lines given below
Figure
Rectangle
Box
-----------
Explanation
------------
Since both Rectangle and Box inherit from Figure class, the objects of these classes can be assigned to variable f of Figure type. The display() function is overriden in both Rectangle and Box and these new definitions are called instead of the one in the Figure class
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.