Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

What is the difference between a Method and a Function?

0 views
Skip to first unread message

BillyTheKid

unread,
Oct 22, 2003, 2:29:07 PM10/22/03
to
I am a little confused on the sematics here. Is a C# "Function" simply a
"Method" that returns a value?


Michael Kremser

unread,
Oct 22, 2003, 2:45:27 PM10/22/03
to
*BillyTheKid* tippselte am *22.10.2003 20:29* MESZ:

> I am a little confused on the sematics here. Is a C# "Function" simply a
> "Method" that returns a value?

A function is just a part of code that executes code and can return
something. A method is, in OOP, a function that is bound to a class. As
in C# there are no stand-alone functions, every function in C# is a method.

Best regards,

Michael

--
Michael Kremser
http://great.dynu.com/

Nicholas Paldino [.NET/C# MVP]

unread,
Oct 22, 2003, 2:46:32 PM10/22/03
to
BillyTheKid,

There really is no difference. The distinction is that in C# a method
is attached to a class. Since it is an OO language, you can't have
functions, which stand alone (outside of classes).

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- m...@spam.guard.caspershouse.com

"BillyTheKid" <n...@nospam.com> wrote in message
news:uX1WzpMm...@tk2msftngp13.phx.gbl...

mikeb

unread,
Oct 22, 2003, 2:47:07 PM10/22/03
to
BillyTheKid wrote:
> I am a little confused on the sematics here. Is a C# "Function" simply a
> "Method" that returns a value?
>
>

Method is simply object-oriented terminology for a function or
subroutine that is scoped to a class.

--
mikeb

Juan Gabriel Del Cid

unread,
Oct 22, 2003, 7:53:06 AM10/22/03
to
> I am a little confused on the sematics here. Is a C# "Function" simply a
> "Method" that returns a value?

Yes, both funtions and procedures (as they are refered to in some structured
programming books) are methods. Don't get tangled with words.

Hope that helps,
-JG


Eric

unread,
Oct 22, 2003, 2:51:10 PM10/22/03
to
No. A method is a function. Same as in Java
0 new messages