Pergunta de entrevista da empresa Fast Enterprises

What is Polymorphism

Respostas da entrevista

Sigiloso

14 de ago. de 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

Sigiloso

9 de mai. de 2015

Pass by reference vs. pass by value