Pregunta de entrevista de BairesDev

What's the difference between overloading and overriding?

Respuesta de la entrevista

Anónimo

18 dic 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).