Possible Duplicate:
What is the difference between Public, Private, Protected, and Nothing?
I have a question : What is the difference between these method types ?
Static , Public , Internal , Protected , const , void
Sorry my question may seem awkward to professionals but i really want to understand the difference , and by the way i searched and read articles about them but they are all big and not well described , i just need a nice example for each so i could make decision each time i make a function , because i always start with private void ........
Your basic method has the following:
There's a few extra bits and pieces but that's your start.
Access Modifiers
Some of those are access modifiers which control which classes have access (can call) whatever you've put the modifier on.
Static
Static
means that the method/variable is shared by all instances of the class. It can be combined with an access modifier from above.Void
void
just means that you have a method that doesn't return anything:const
const
means that the variable cannot be modified: