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

How can a called function determine the number of arguments that have been passed to it?

650


Define a constructor?

579


How a new operator differs from the operator new?

612


What do the header files usually contains?

617


Is c++ a high level language?

542






List the types of polymorphism in c++?

613


What are its advantages and disadvantages of multiple inheritances (virtual inheritance)?

597


What is #include math h in c++?

563


Is dev c++ free?

606


what are the iterator and generic algorithms.

1451


what is c++

1787


Explain what you mean by a pointer.

615


What are virtual constructors/destructors?

567


How do I tokenize a string in c++?

599


How c functions prevents rework and therefore saves the programers time as wel as length of the code ?

610