3
$\begingroup$

Would saying "Call the printf function" be the same as "Call the printf method"?

$\endgroup$

1 Answer 1

7
$\begingroup$

These are a different level classifications:
A method is a function (or procedure) associated with object – a concept from Object Oriented Programming.

A function is the logical unit (a piece of reusable code called by name) independent of any objects (those might not even exist in particular language). So the method is a function, but a function exists also in non-OO languages, so the reverse is not true.

$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.