• Business
  • Finance
  • Banking
  • Education
  • General
  • Law
  • Science
  • IT
  • English

Key Differences

Know the Differences & Comparisons

Difference Between Method Overloading and Overriding

method overloading vs method overridingMethod Overloading

Method overloading, also known as Function overloading or Compile time polymorphism, is a concept of having two or more methods with the same name but different signature in the same scope. There are many programming languages that support this feature: Ada, C++, C#, D, and Java.

Example of Method Overloading in C#
overloadingAs shown in the above example, the method ‘Polygon’ is overloaded 3 times with different method signature, i.e the type or the number of parameters are different.

Method Overriding

Method overriding, also known as Function overriding or Run time polymorphism, is an OOP feature that allows a child class to provide its own implementation to the method defined in the parent class. The implementation in the child class overrides the definition of the method in the base class, provided that the method in the child class should have the same name, signature and return type.

Example of Method Overriding in C#
overridingHere, the draw method in the Source2 class overrides the draw method defined in the Source1 class.

Difference Between Method Overloading and Method Overriding

  1. In Method overloading methods must have a different signature. In method, overriding methods must have the same signature.
  2. Function Overloading is to “add” or “extend” more to method’s behaviour. Function overriding is to completely “change” or “redefine” the behaviour of a method.
  3. Method overloading is used to achieve Compile time polymorphism; method overriding is used to achieve run-time polymorphism.
  4. In method/function overloading compiler knows which object assigned to which class at the time of compilation, but in method overriding this information is not known till runtime.
  5. Function Overloading takes place in the same class whereas Overriding takes place in a class derived from a base class.

You Might Also Like:

abstract class vs interfaceDifference Between Abstract class and Interface in C# Difference Between Interface and Class Pooling of Interest Vs Purchase MethodDifference Between Pooling of Interest Method and Purchase Method ref vs out parameterDifference Between ref and out parameter in c# research method vs methodologyDifference Between Research Method and Research Methodology childish-vs-childlikeDifference Between Childish and Childlike

Comments

  1. karamath sheik says

    February 4, 2016 at 3:11 pm

    Thanks for choosing this post to write it thanks one again…

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Top 5 Differences

  • Difference Between PERT and CPM
  • Difference Between Micro and Macro Economics
  • Difference Between Developed Countries and Developing Countries
  • Difference Between Management and Administration
  • Difference Between Qualitative and Quantitative Research



New Additions

  • Difference Between Deforestation, Reforestation and Afforestation
  • Difference Between Race and Ethnicity
  • Difference Between Customer Service and Customer Experience
  • Difference Between Human Capital and Human Development
  • Difference Between Systems Approach and Contingency Approach
  • Difference Between Industrial Relations and Employee Relations
  • Difference Between Introduction and Executive Summary
  • Difference Between Programmed and Non-programmed Decisions
  • Difference Between Depreciation and Devaluation of Currency
  • Difference Between Consumer Market and Business Market

Categories

  • Banking
  • Business
  • Education
  • English
  • Finance
  • General
  • IT
  • Law
  • Science
fb-follow youtube follow

Copyright © 2025 · Key Differences · Contact Us · About Us · Privacy