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

Answer Posted / bebo

prvate:is accessed by members of that class only.

public:is accessed by members of any class

protected: variables that are visible only
to the class to which they belong, and any subclasses.

Is This Answer Correct ?    22 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between struct and class?

729


Mention the ways in which parameterized can be invoked.

532


Why c++ is better than c language?

555


What is flush programming?

560


When should you use global variables?

619






How can you prevent accessing of the private parts of my class by other programmers (violating encapsulation)?

635


Is c++ a software?

716


What is ifstream c++?

549


How should a contructor handle a failure?

673


What is the full form of india?

556


What are static type checking?

620


What is #include iostream h in c++?

598


Explain object slicing in c++?

578


What is the full form nasa?

589


How is c++ different from java?

555