开发者

Difference between function and method? [duplicate]

开发者_JAVA百科This question already has answers here: Closed 12 years ago.

Possible Duplicate:

method vs function vs procedure vs class ?

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


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


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

also see here


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜