Microsoft .Net Framework Interview questions and answers FAQ's, .Net 2.0, .Net 3.0, .Net 3.5, WPF - WCF, C#.NET, ASP.Net, VB.Net,ADO.Net, Web & desktop development questions.
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.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment