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.

Comments

Popular posts from this blog

How to create Rest API(Web API) with ASP.NET Core 1.0

Creating PDF with ASP.Net MVC and RazorPDF

Solution: gulp is not recognized as internal or external command- Visual Studio