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.

Advertisements

Responses

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


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: