Frage im Vorstellungsgespräch bei Fast Enterprises

Explain Polymorphism?

Antworten zu Vorstellungsgespräch

Anonym

4. Sept. 2014

Different sub classes can inherit similar methods. Truck and Sedan both fall under the class VEHICLE and share the methods (attribute) ACCELERATE, BRAKE.

Anonym

19. Juli 2015

The 1st answer is Inheritance, another object orientated principle. Polymorphism literally means having many forms. It refers to a subclass also being a form of a superclass. IS-A relationship. A Truck is a Vehicle and a Sedan is a Vehicle. Polymorphism can also be found in methods at compile time with overloading and at runtime with overriding.