Overloading VS Overriding

  • Overloading is about same function have different signatures.

  • Overriding is about same function, same signature but different classes connected through inheritance.

  • Overloading is an example of compiler time polymorphism and overriding is an example of run time polymorphism.

overloading

e.g.1

e.g.2

e.g.3 to be continue...

Override

polymorphism

Last updated