Access Modifiers
An access modifier determines which class methodsâincluding methods of other classesâcan see and use a member variable or method within a class. Table 18-1 summarizes the Visual Basic 2005 access modifiers .
Table 18-1. Access modifiers
Access modifier |
Restrictions |
---|---|
|
No restrictions. Members marked |
|
The members in class A which are marked |
|
The members in class A which are marked |
|
The members in class A which are marked |
|
The members in class A which are marked |
Tip
The Protected
access modifier is used with derived classes, as explained below in the discussion on inheritance. The Friend
accessor says that the members are visible to any method within the Assembly. An assembly is a collection of files that appear to the programmer as a single executable (.exe) or DLL.
It is good programming practice to explicitly set the accessibility of all methods and members of your class.
Get Programming Visual Basic 2005 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.