+ 1

Method or Function

What is the difference between method and function?

25th Aug 2017, 8:56 AM
Zeron
Zeron - avatar
3 Answers
+ 2
no difference in java we call it method.. and in c c++ and other languages it is callled as function
25th Aug 2017, 8:57 AM
ŠœŠ³. ŠšŠ½Š°ŠæšŸŒ 
ŠœŠ³. ŠšŠ½Š°ŠæšŸŒ  - avatar
+ 8
Method - typically means a member function pertaining to a class or struct. Function - typically means it does not belong to a class or struct. What things are called really depends on the language's community. In C++ methods are called member functions more often than methods, while in languages such as Java it's more common to call them methods.
25th Aug 2017, 9:22 AM
aklex
aklex - avatar
+ 1
i think in c++ Functions have return type Method don't have return type. in java there just called methods whether its a function or not.
25th Aug 2017, 9:07 AM
D_Stark
D_Stark - avatar