Pergunta de entrevista da empresa BairesDev

What's the difference between overloading and overriding?

Resposta da entrevista

Sigiloso

18 de dez. de 2018

Overloading: you have different methods or functions with the same name. At compile time the compiler chooses which one to apply based on the types of the passed arguments. Overriding: A base class has a method and a derived class redefines it with the same signature. The decision on which to use might happen at compile time or at dynamically runtime if the type of the object is only known then (dynamic dispatch).