S.No |
Functions |
Methods |
1 |
Functions do not have any reference variables |
Methods are called by reference variables |
2 |
All data that is passed to a function is explicitly passed |
It is implicitly passed the object for which it was called |
3 |
It does not have access controlling i.e.,Function(other than static functions) declares and defines anywhere in the code |
It has access controlling i.e.,Method should declare and define in the class only
|
4 |
Function applies to both object oriented and non-object oriented language(procedural language.eg. C, Scripting language eg; JavaScript etc) |
Method is only applicable to object oriented programming language like C++, C#, Java etc
|