answersLogoWhite

0

It means the member is only accessible to the class itself, and to friends of the class.

Protected members are the same as private members but are also accessible to derived classes.

Public members are fully accessible.

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

Can you access in drive class from base class private data?

Base class should no knowledge about derived classes. The "private" modifier on a data member means private to the class which defined it. Base class cannot directly reference/access the private data member of the derived class, and the derived classes cannot access the private data member defined in the base class. Either way the accessing the private data member should be done via properties or getters


What is the difference between public and private in c plus plus?

A private member can only be accessed by other methods of the same class, while a public member can be accessed by methods of any class or by non class code.


Is the default access specifier same as protected?

A private member of a class can only be accessed by methods of that class. A protected member of a class can only be accessed by methods of that class and by methods of a derived class of that class.


What are Public and Private inheritance in c plus plus?

Public, protected and private inheritance determine how the public and protected base class members are inherited by the derived class. Private members are never inherited and are therefore unaffected by the type of inheritance (they remain private to the base class). The following table summarises how inheritance affects accessibility of base class members with respect to the derived class: public inheritanceprotected inheritanceprivate inheritancepublic member of base classpublic member of derived classprotected member of derived classprivate member of derived classprotected member of base classprotected member of derived classprotected member of derived classprivate member of derived classprivate member of base classprivate member of base classprivate member of base classprivate member of base class Note that accessibility to individual public and protected base class members can be overridden within the derived class, regardless of the type of inheritance specified.


Difference between public member and private member of a class in Java?

public members can be accessed from outside the class they were declared in, private members can only be accessed from within the class they were declared in. Private members are commonly manipulated through get/set methods, which allows for greater encapsulation and hides the implementation from the calling function. Example: class sampleClass{ private: int private_member; public: int public_member; public: void setPrivateMember(int x){private_member = x;}; // private members can be accessed from within the class that they are declared in public: int getPrivateMember(){return private_member;}; }; int main() { sampleClass A; A.public_member = 5; // Perfectly legal A.private_member = 7; // Syntax error, this will not compile A.setPrivateMember(7); // Legal cout << A.getPrivateMember(); // Legal return 0; }


What is the reason for making Data as Private Member of a Class?

this is the reason for security purpose


What is private specifier in c plus plus?

The private specifier states that the member can only be accessed by the containing class, and not by any derived class, nor by any other code outside of a class.


Which base class member functions are not inherited by a derived class?

Derived classes only inherit the protected and public members of their base classes. Private member functions cannot be inherited by a derived class.


What is the meaning of private in private James Ryan?

The rank of a military member, most likely Army e-1


What is the use of private constructor in c plus plus?

Private construction prevents objects from the class from being instantiated other than via a static member function of the class, a friend function or a friend class.


What is the purpose of the keyword private?

The private keyword is used to ensure that no other classes will be able to access (view or modify) that class member.


What is member hiding?

Whne you define a member with reserved word private, you hide it from other part of program except that class where it was defined.