Finishing the Static Model - Generalization, Specialization, and Inheritance - Polymorphism
4 important questions on Finishing the Static Model - Generalization, Specialization, and Inheritance - Polymorphism
An operation on a superclass will be inherited by its subclasses.
Not only will the argument list be inherited, but if...?
Even if the method is available on the superclass, it can be....?
If we looked at the code of FigureManager.getDiagramArea() , what would we see?
totalArea = 0
loop over GeometricFigures in ordered set of Figure:GeometricFigures
get next GeometricFigure
totalArea = totalArea = GeometricFigure.getArea()
endLoop
return totalArea
- Higher grades + faster learning
- Never study anything twice
- 100% sure, 100% understanding
Why is polymorphism a big advantage?
It incorporates information hiding, i.e., the details of the getArea() operation are not exposed outside of the Circle or Square
The question on the page originate from the summary of the following study material:
- A unique study and practice tool
- Never study anything twice again
- Get the grades you hope for
- 100% sure, 100% understanding