|
-
December 11th, 2011, 12:04 PM
#1
Methods, confused!
Heya,
I'm having a hard time wrapping my head around the OOP design of C# and how to correctly use methods.
Say I want to create a function that will be called multiple times(which I guess is always called a method in C#?).
I obviously don't want to put it in my main class, since I will call it more than once.
I can't seem to make any function outside of a class .. anything that happens in C# happens inside a class or structure type, period?
If I want to put my algorithm outside of my main function, which doesn't have any variables and which simply needs to be called (uses 2 parametres), I create a static class?
If any small function would reside in a class which uses a reference, wouldn't that create a lot of overhead?
Thank you.
Last edited by Candystore; December 11th, 2011 at 12:08 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|