10.8. Friend Members

Another intermediate level of member access is Friend access. A class’s Friend members can be accessed only by code in the same assembly. In a program or an assembly that consists of one class declaration, declaring a member with Friend access has no specific effect. However, if a program uses multiple classes from the same assembly, these classes can access each other’s Friend members directly through references to objects of the appropriate classes. Unlike Public access, any other programs that are declared outside the assembly cannot access these Friend members. To access a non-Shared Friend member within the same assembly, you would first have to create an object of the class that declares the Friend member, then invoke ...

Get Visual Basic 2005 for Programmers: Deitel Developer Series, Second Edition 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.