Domanda di colloquio di Fast Enterprises

What is Polymorphism

Risposte di colloquio

Anonimo

14 ago 2015

Polymorphism is perhaps most commonly referred to functions/methods that are overloaded based on the parameters being passed in, for example add(int x, int y) vs. add(string a, string b). In object oriented, this also refers to subtyping. Consider a Vehicle super class and a Bus and Airplane class that inherit from Vehicle. Now a method of a Vehicle object can behave differently depending on whether the vehicle is also a Bus or Airplane. Also a Bus object is now both a Bus and a Vehicle.

2

Anonimo

9 mag 2015

Pass by reference vs. pass by value