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

Which bitwise operator is used to check whether a particular bit is on or off?

583


Is eclipse good for c++?

532


Explain selection sorting?

632


What is a constructor and how is it called?

587


What is a linked list in c++?

536






Where can I run c++ program?

585


Which of the following is evaluated first: a) && b) || c) !

1791


What are mutator methods in c++?

635


Can we change the basic meaning of an operator in c++?

646


Which command properly allocates memory a) char *a=new char[20]; b) char a=new char[20]; c) char a=new char(20.0);

607


Is c++ a high level language?

544


How did c++ get its name?

562


What is the difference between structures and unions?

575


What are the advantages of using friend classes?

617


Is c++ a good beginners programming language?

574