Using Access Modifiers
C# supports the following access modifiers, which you can use when declaring a class, method, or property:
• Public— A public class, method, or property has no access restrictions.
• Protected— A protected method or property can be accessed only within the class itself or a derived class.
• Internal— An internal class, method, or property can be accessed only by a component within the same assembly (dll file). Because ASP.NET pages are compiled into different assemblies than the contents of the App_Code folder, you cannot access an internal member of a class outside of the App_Code folder.
• Private— A private class, method, or property can be accessed only within the class itself.
Visual Basic .NET supports the following ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access