What's the difference between a method and a function?

前端 未结 30 3350
粉色の甜心
粉色の甜心 2020-11-21 05:08

Can someone provide a simple explanation of methods vs. functions in OOP context?

30条回答
  •  别那么骄傲
    2020-11-21 05:38

    Simple way to remember:

    • Function → Free (Free means not belong to an object or class)
    • Method → Member (A member of an object or class)

提交回复
热议问题