Difference between Method and Function ?
Difference between Method and Function ?
Is these similar or not ?
Mention some examples for that ...!
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Aug 23, 2013, 4:20 AM
1. Methods
2. Properties
3. Events
4. Indexers
5. User-defined operators
6. Instance constructors
7. Static constructors
8. Destructors
So, in the context of C#, the correct answer is that a method is a type of function member.
More generally in object oriented programming, a method is a sub-routine which is a member of a class whereas a function is a sub-routine which is not a member of a class.
Abhineet SrivastavaPosted Aug 23, 2013, 2:33 AM
Cheers
om prakashPosted Aug 23, 2013, 2:32 AM
A function allows you to encapsulate a piece of code and call it from other parts of your code. You may very soon run into a situation where you need to repeat a piece of code, from multiple places, and this is where functions come in. In C#, they are basically declared like this:
Iftikar HussainPosted Aug 23, 2013, 2:26 AM
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 fuctions.
Regards,
Iftikar
Sanjeeb LenkaPosted Aug 23, 2013, 2:21 AM
http://www.codeproject.com/Questions/198819/difference-between-method-and-function