问题
Possible Duplicate:
method vs function vs procedure vs class ?
Can some one give the differences between a method and a function?
回答1:
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
回答2:
In java, and c++, by convention a function is called a method if it is member of a class.
also see here
回答3:
In many languages methods don't return values while functions do.
来源:https://stackoverflow.com/questions/3280005/difference-between-function-and-method