What are the differences between public, private, and
protected access?

Answer Posted / golledla prathap reddy

public data can access anybody in the program.
private data can access olny members of that class.
protected also same like private but the difference is it
can access by derive class also.
we can see the use of protected data in inheritance.

Is This Answer Correct ?    64 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which software is used for c++ programming?

612


What are the restrictions apply to constructors and destructors?

641


Should the member functions which are made public in the base class be hidden?

556


What is the use of structure in c++?

553


How do I make turbo c++ full screen?

581






What type of question are asked in GE code writing test based on c++ data structures and pointers?

3501


Explain the virtual inheritance in c++.

592


Mention the ways in which parameterized can be invoked. Give an example of each.

568


What is a memory leak c++?

587


What is c++ 11 and c++ 14?

581


What is friend class in c++ with example?

496


Explain the differences between list x; & list x();.

598


What is c++ used for in games?

600


What is c++ runtime?

651


Do we have to use initialization list in spite of the assignment in constructors?

563