I read many notes and online tutorials but I don't have clear idea what is the basic difference between method overriding
and function overriding
and function overloading
and method overloading
.

- 4,839
- 6
- 26
- 46

- 113
- 2
- 10
-
please help me with real life example if possible. – Malik Asad Ali Aug 14 '17 at 04:27
-
What is the difference between a method and function for you, in terms of overloading and overriding? – Yeldar Kurmangaliyev Aug 14 '17 at 04:28
-
i know that method and function is same. – Malik Asad Ali Aug 14 '17 at 04:30
-
@MalikAsadAli They are not the same, please see my answer. – identicon Aug 14 '17 at 04:31
-
in C#, method and function , both these word are same, use as method. – Hiran Aug 14 '17 at 04:34
-
1In C#, the terms "method" and "function" are effectively interchangeable. So your question is really just asking about the difference between overloading and overriding. Which has been discussed to great extent already. We didn't need a new question. See marked duplicate for one of the earliest and most-thorough examples. – Peter Duniho Aug 14 '17 at 04:45
3 Answers
For fully object oriented programming, I mean the languages like C# or Java there are only methods, there is no function.
For fully scripting langauges like C there is no method, there are functions.
For mixed languages like C++, perl, python, php there are both. When code will beused as script then they'll call function, when code will be used as class then they will call method.
Please check http://study.com/academy/lesson/oop-object-oriented-programming-objects-classes-interfaces.html for more detail definition.

- 196
- 2
- 14
Simple explanation.
Method overloading is having two or more methods with the same name with a different number and/or different type of parameters.
eg:
public void AddDog(string type){}
public void AddDog(string type, string color){}
Method overriding allows a class to alter an inherited classes method.
eg:
public class Dog
{
public virtual void Bark()
{
Console.WriteLine("Roff");
}
}
public class Wolf:Dog
{
public override void Bark()
{
Console.WriteLine("Grrr");
}
}

- 2,322
- 1
- 17
- 32
-
-
Fully OOP languages use methods rather then functions as the previous answers explain. The closest you will get to a function is static methods in c#. – Xela Aug 14 '17 at 04:47
The only difference is whether or not a method or a function is being overridden/overloaded. See Difference between a method and a function

- 967
- 10
- 20