+ 2

What is the Exact Difference between Method and Function of Programming???

Both Contain Parenthesis.... I get Confused 😰😩😭

13th Jan 2021, 5:33 AM
Rashed-Ul Anwar
Rashed-Ul Anwar - avatar
3 ответов
+ 7
Both are same, but when you are talking about a function inside a class it's called method . for example we say Math class have many methods like pow(), sqrt() etc
13th Jan 2021, 5:39 AM
Abhiyantā
Abhiyantā - avatar
+ 7
Function and methods are both identical but method is called by an object and defined in a class where as a function is independent,
13th Jan 2021, 5:45 AM
v@msi😉
v@msi😉 - avatar
0
Another way of looking at it is that you can write a function to create your own method
13th Jan 2021, 7:49 AM
Rik Wittkopp
Rik Wittkopp - avatar