Overloading
about overloading and overriding
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Satyapriya NayakRank #47 · 31.5K reputationPosted Apr 4, 2013, 6:15 AM EDT
Jignesh TrivediRank #16 · 50.3K reputationPosted Apr 4, 2013, 7:37 PM EDT
hi,
In overloading two or more method has same name but different signatures.At compile time, the compiler find out which one method going to call, based on the compile time types of the arguments and the target of the method call.
public void MyTest()
{
}
public void Mytest(int id)
{
}
public MyTest(int id, string name)
{
}
Overloaded methods improve code clarity.
An override method provides a new implementation of a member inherited from a base class.it allows you to invoke functions (that have the same signatures) that belong to different classes in the same hierarchy of inheritance using the base class reference.
public class test
{
public virtual void getName(int id)
{
}
}
public class test2 : test
{
public override void getName(int id)
{
}
}
In overriding, name and signatures both are same.
Please refer
http://www.dotnetfunda.com/interview/exam3921-differences-between-method-overloading-and-method-overriding.aspx
hope this will help you.