Access Modifiers
Last updated
Was this helpful?
Last updated
Was this helpful?
Access modifiers control access to class instance variables and class methods. The default access for class instance variables (fields) and methods in C# is private, if none is specified as part of a declaration / definition then the access is private. Protected access modifier allows child classes to access a base-class variable as if it were public, but outside the base and child classes, the variable access is restricted as if access were specifiec as private.
C# Access modifiers: