Thursday, January 15, 2009

Member of class - Object Oriented Programming


Definitions Of Object:
An object is combination and collection of data and code designed to emulate a physical abstract enmity.You can create number object of class. The properties, Variable and Methods define in class are called Members of class.

  1. Private Member Of Class: Private member of a class have strict access control Only the member function of same class can access this members.
  2. Protected Member of Class: A Protected member is accessible to member of its own calls and to any of the class member in a derived class.
  3. Public Member Of Class: A public member of class can be accessible from any where.
  4. Public and Private Static Member Of a Class: The static member of a class can be access without creating a object of class. While to access other member of class you have to create a object of class. The public static member can be accessed using access specifier while private static member can be accessed only the member functions.
Inheritance and Member Accessibility:
  1. A private member is accessible only to members of the class in which private member is declared. They cannot be inherited
  2. A private member of the base class can be accessed in the derived class through the member of the base class.
  3. A protected member is accessible by member of its own class and to any of the class member in a derived class.
Share:

0 comments:

Post a Comment

Your feedback is very important to me. Please provide your feedback via putting comments.

About Me
My Photo

Full Stack Developer,Blogger,Microsoft Mvp, Mentor, Life long learner, 10+ Years of Experience for JavaScript, web and Microsoft technologies. ASP.NET MVC,Web Forms,C#,AngularJs,Golang
Mvp profile
Subscribe to my blog

Enter your email address:

Follow us on facebook
Blog Archive
Total Pageviews