Class modifiers in VB.NET

Thought it would be nice to refresh memory on this.

 

Public
There are no restrictions on the use of a class declared as Public.

 

Private
A Private class is accessible only within its "declaration context" including any nested entities. A nested procedure is an example of a nested entity. A Public variable in a Private class is accessible from inside the class, but not from outside that class.

 

Protected
Protected means that elements are accessible only from within their own class or from a derived class. Protected can also be used with the Friend keyword. When they're used together, elements are accessible from the same assembly, from their own class, and from any derived classes.

 

Friend
Friend access means that elements are accessible only within the program. Friend is the default access modifer for any class that does not have a modifier.

Comments

Popular posts from this blog

Tagging Classic Music albums with Mp3tag for iTunes and Last.fm

DVD to WMV9 Guide 4.5

Having to remove shoes before you enter someone’s house