I have been programming in C# for more than 3 years now, always I forget the specifics on keywords like access modifiers. The most commonly used access modifiers are of course 'public' and 'private', and it's pretty obvious what they mean. But for example "protected internal", I just cannot recall on top of my head what it pertains to, so just as a note, here's all of them:
Access Modifier | Meaning |
---|---|
public | Available to all classes |
protected | Available only to the current class or to derived classes |
internal | Available only to classes in the current assembly |
protected internal | Available only to the current class, derived classes, or classes in the current assembly |
private | Available only to the containing class |
virtual | Creates a virtual method or property that can be overriden by a subclass |
1 comments:
For further info on access modifier defaults see http://blogs.oberon.ch/tamberg/2007-10-30/understanding-csharp-access-modifiers.html
Post a Comment