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 are the two main components of c++?

591


What do you mean by function overriding & function overloading in c++?

604


What are libraries in c++?

609


What is pure virtual function?

633


What is a Default constructor?

924






Is sorted c++?

579


What is c++ best used for?

569


What are pointers used for c++?

573


What is the prototype of printf function?

659


Write is a binary search tree? Write an algo and tell complexity?

597


What is the difference between containment and delegation?

706


Suppose that data is an array of 1000 integers. Write a single function call that will sort the 100 elements data [222] through data [321].

964


Write a struct time where integer m, h, s are its members?

524


What is an adaptor class or wrapper class in c++?

609


What is a container class?

623