Safe Software interview question

Explain inheritance and polymorphism.

Interview Answer

Anonymous

Dec 10, 2017

Polymorphism is a concept in which disparate objects may present themselves (to a greater or lesser extent) in much the same way. For example a POINT object and a BOX object may both appear to be the same in many ways such as their ability to have a location, (likely itself a POINT object), translate within the X/Y plane, rotate about another point, scale, etc. Quite often this is implemented through the use of a common base class which presents the similar behaviour or the interface, with the actual implementation details possibly delegated to the subclasses.