Domanda di colloquio di Fast Enterprises

Explain Polymorphism?

Risposte di colloquio

Anonimo

4 set 2014

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

Anonimo

19 lug 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.