tags:

views:

68

answers:

3

Possible Duplicate:
method vs function vs procedure vs class ?

Can some one give the differences between a method and a function?

+2  A: 

Both are the same. Both are subroutines and both can return a value. Only difference may be the attachment to class. Method sounds more attached to a class but again, people use to call the non attached ones too methods. So, in that aspect too they can be seen as same

Bragboy
A: 

In many languages methods don't return values while functions do.

Johann Strydom
Subroutines which do not return values are called procedures by some. The definition of a method does not specify wether or not a value is returned.
sum1stolemyname
+1  A: 

In java, and c++, by convention a function is called a method if it is member of a class.

also see here

sum1stolemyname