Tuesday, May 13, 2008

Briefly explain the difference between Public (public), Friend (internal), and Private (private) access levels as they apply to user-defined types and

In user-defined types, Public (public) classes can be instantiated by any element of the application. Friend (internal) classes can be instantiated only by members of the same assembly, and Private (private) classes can be instantiated only by themselves or types they are nested in. Likewise, a Public (public) member can be accessed by any client in the application, a Friend (internal) member can be accessed only from members of the same assembly, and Private (private) members can be accessed only from within the type.

No comments: