different between method and function

A method is on an object.

A function is independent of an object.

For Java, there are only methods.

For C, there are only functions.

For C++ it would depend on whether or not you're in a class.

posted @ 2017-02-02 23:27  行知散人  阅读(187)  评论(0编辑  收藏  举报