In object-oriented programming (OOP), a method is a function contained in an object, whereas a function is not.
2006-07-19 05:09:58
·
answer #1
·
answered by Kookiemon 6
·
2⤊
0⤋
Well to be honest its pretty much been nailed by Andy. Although I would be careful when people say they are the same thing. They do represent two fundamentally different approaches to programming, namely procedural/iterative versus Object Orientated.
Functions essentially return a value and have become synonymous with older style programming languages such as C. Methods however don't need to return a value and are used to carry out actions associated with an Object (as Andy quite rightly explained) but a method has scope which is implicit by its association with its parent object. It is strongly tied to the object it is called from whereas a function may not.
Hope this helps
Another Andy
2006-07-20 23:49:05
·
answer #2
·
answered by powkesmore 2
·
0⤊
0⤋
In programming, "method" and "function" are de facto the same thing. Both are code that does something, like "getUserID" or "lookupDefinition(word)"..
The term "function" originated in structural programming to define code that did something and returned a value. Later in Object Oriented programming, "method" described code that did something relating to its class. For example, a class called Person has atttributes such as name, age, hair color, etc - and methods named walk(), eat(), drink(), sleep(), talk(words), etc.
So, in today's programming, functions are called "methods." They -do- something.
Cheers,
Andy
2006-07-19 05:17:57
·
answer #3
·
answered by xx342334234234 2
·
0⤊
0⤋
apart from the previous answers i'll add some.
In java we call them methods. we don't call these things functions. But when it comes to the C or C++ we call them functions. So in the context of programming there is no difference between them.
2006-07-19 05:15:51
·
answer #4
·
answered by Anonymous
·
0⤊
0⤋
Functions that belong to a class are called the methods of that class. There are several types of functions that you can use in your applications, including built-in functions, named and user-defined functions, anonymous functions, callback functions, constructor functions, and function literals.
2006-07-22 16:25:54
·
answer #5
·
answered by Tiru 2
·
0⤊
0⤋
a method is a way we do things and try out new ways a function is what something does and was made to do ??
2006-07-19 05:00:30
·
answer #6
·
answered by ââ¢Â¥ ââ¢Â¥abc 4
·
0⤊
0⤋
as andy above as said, in reality they are the same thing. just different people with different backgrounds use either word to mena the same thing.
if you look at javascript there called functions, in c#.net there called voids/methods
2006-07-19 21:14:25
·
answer #7
·
answered by Anonymous
·
0⤊
0⤋
Method - The way is should work
Function - How it actually works
2006-07-19 05:01:06
·
answer #8
·
answered by super_star 4
·
0⤊
0⤋
you won't be able to analyze a guy to a woman. each is diverse. yet a guy, and a woman, supplement one yet another. In different words, one guy and one lady (mutually) is one unit. they're a complementary pair.
2016-10-14 23:12:28
·
answer #9
·
answered by Anonymous
·
0⤊
0⤋
Fuction is something that is happening and method is how that it happens.
2006-07-19 05:00:10
·
answer #10
·
answered by Elite117 3
·
0⤊
0⤋