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

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

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

30条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-21 05:49

    A very general definition of the main difference between a Function and a Method:

    Functions are defined outside of classes, while Methods are defined inside of and part of classes.

提交回复
热议问题