Posted by: Amit Andharia | January 3, 2009

Private Access Modifier

 

The private keyword is a member access modifier. Private access is the least permissive access level. Private members are accessible only within the body of the class or the struct in which they are declared, as in this example:

class Employee
{

private int k;
double l; // private access by default

}

It is a compile-time error to reference a private member outside the class or the struct in which it is declared.


Responses

  1. […] modifier: A keyword, such as private, protected, internal, or public, that restricts access to a type or type […]


Leave a comment

Categories