vb.net access modifier

1
VB.Net Access modifiers Access modifier Description Friend Defines a type that is accessible only from within the program in which it is declared. Private Defines a type that is accessible only from within the context in which it is declared. For instance, a Private variable declared within a class module is accessible only from within that class module. A Private class is accessible only from classes within which it is nested. Protected Applies to class members only. Defines a type that is accessible only from within its own class or from a derived class. Protected Friend Defines a type that is accessible from within the program in which it is declared as well as from derived classes. Public Defines a type that is publicly accessible. For example, a public method of a class can be accessed from any program that instantiates that class.

Upload: muneeb-khan

Post on 10-Apr-2015

1.645 views

Category:

Documents


3 download

TRANSCRIPT

VB.Net Access modifiers

Access modifier Description

Friend

Defines a type that is accessible only from within the program in which it is declared.

Private

Defines a type that is accessible only from within the context in which it is declared.For instance, a Private variable declared within a class module is accessible only fromwithin that class module. A Private class is accessible only from classes within which itis nested.

Protected

Applies to class members only. Defines a type that is accessible only from within itsown class or from a derived class.

ProtectedFriend

Defines a type that is accessible from within the program in which it is declared as wellas from derived classes.

Public

Defines a type that is publicly accessible. For example, a public method of a class canbe accessed from any program that instantiates that class.