首页 > 代码库 > different between method and function

different between method and function

<style>p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 15.0px Arial; color: #242729 } p.p2 { margin: 0.0px 0.0px 0.0px 0.0px; font: 15.0px Arial; color: #242729; background-color: #ffffff } span.s1 { background-color: #ffffff } span.s2 { }</style>

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.

different between method and function