What is a difference between a method and a function?

后端 未结 7 1491
礼貌的吻别
礼貌的吻别 2020-12-08 00:15

What is the difference between a method and a function? Is it that a method returns a value and a function doesn\'t?

7条回答
  •  孤街浪徒
    2020-12-08 00:46

    The difference between the expressions "method" and "function" is that a "method" is a member function of a class, whereas a standalone function does not, and a standalone function usually exists in global context.

提交回复
热议问题