I am a beginner in c# and have a keen interest to learn c#, but I am confused. When I asked some one what the difference is between Function and method, he said to me that there is no difference, that they both have the same functionality.
Now I am quite confused and want to know from good developers what methods and functions are?
Are they both the same? If not, then how do I initialize each one??
Is this way to initialize a function correct?
public void UpdateLeaveStatus(EmployeeLeave objUpdateLeaveStatus)
Please provide proper help as I am new.
This question is tagged with
~ Asked on 2012-09-04 07:49:28
Both are same, there is no difference its just a different term for the same thing in C#.
In object-oriented programming, a method is a subroutine (or procedure or function) associated with a class.
With respect to Object Oriented programming the term "Method" is used, not functions.
~ Answered on 2012-09-04 07:50:22
When a function is a part of a class, it's called a method.
C# is an OOP language and doesn't have functions that are declared outside of classes, that's why all functions in C# are actually methods.
Though, beside this formal difference, they are the same...
~ Answered on 2012-09-04 07:57:10