Monday, October 6, 2008

Syntax for a class

Class Statement [ Public | Private | Protected |
Friend | Protected Friend ]
[ Shadows ][ MustInherit | NotInheritable ] _
Class name [ Inherits classname ][ Implements interfacenames ]
[ statements ]
End Class

Modifiers Brief explanation

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.

No comments: