What is the difference between public, private, protected
inheritance?

Answer Posted / girish kumar

publc: variable declare in public can be access anywhere in the program i.e. other classes can also use same variable which are declare once.
private:variable declare in private can't be access outside the class in which it is declare .Variable are only access in the same class.

Is This Answer Correct ?    24 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When can I use a forward declaration?

809


What is std namespace in c++?

898


What is istream c++?

827


What is the difference between a declaration and a definition?

806


When should we use container classes instead of arrays?

789


What is auto used for in c++?

773


What is istream and ostream in c++?

803


What is namespace & why it is used in c++?

790


What is encapsulation in c++ with example?

753


what are Access specifiers in C++ class? What are the types?

844


What is the difference between public and private data members?

881


What is a hash function c++?

767


What is stl containers in c++?

775


What is the use of lambda in c++?

764


What are the advantages of c++ over c?

812