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

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

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

30条回答
  •  萌比男神i
    2020-11-21 05:53

    Methods are functions of classes. In normal jargon, people interchange method and function all over. Basically you can think of them as the same thing (not sure if global functions are called methods).

    http://en.wikipedia.org/wiki/Method_(computer_science)

提交回复
热议问题