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

Answer Posted / alka choubey

public:class members are access from the outside the class.
private:class members are access only within the class.
protected:class members can access inside the same package.

Is This Answer Correct ?    29 Yes 13 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

find the two largest values among the 6 numbers using control structures : do-while,for,if else,nestedif- else ,while. one or two of them.

2001


What is #include c++?

571


What are c++ tokens?

594


what is scupper?

1895


If dog is a friend of boy and boy is a friend of house, is dog a friend of house?

557






How to declare a pointer to an array of integers?

648


Is it possible to have a recursive inline function in c++?

559


What is the best c++ book?

714


Can you please explain the difference between overloading and overriding?

603


What is polymorphism & list its types in c++?

625


Explain the difference between using macro and inline functions?

579


Will rust take over c++?

598


Is c++ free?

585


Which ide is best for c++?

549


When can I use a forward declaration?

626