Encapsulating Types and Members

Encapsulation is a very important concept in object-oriented programming. From a software designer's point of view, encapsulation is the practice of packaging code and data into a single class, and then hiding as many of the implementation details as possible from the class users. A stand-alone class (i.e., one that is not nested within other classes) must be either a public type or a friend type. Public types are exposed to other assemblies and are declared with the Public keyword. Friend types are not exposed to other assemblies and are declared with the Friend keyword. A class is implicitly declared as a friend type if you do not supply either the Public or the Friend keyword in its declaration.

When you're ...

Get Building Applications and Components with Visual Basic .NET 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.