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

Answer Posted / abhay

public-->inherite the protected members as preotected in
drived class and pubic members wiull be public in derived
class

protected--->pubic and protecated members of the base class
will become protected in derived class

Private-->pubilc and proteacted members will become private
in derived class

Is This Answer Correct ?    14 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between #define debug 0 and #undef debug?

634


Why do we need function?

590


Explain about vectors in c ++?

587


Write a corrected statement in c++ so that the statement will work properly. if (4 < x < 11) y=2*x;

1497


How do you generate a random number in c++?

597






Show the application of a dynamic array with the help of an example.

576


What is the difference between set and map in c++?

598


What is the role of C++ shorthand's?

661


How is static data member similar to a global variable?

572


How do you find out if a linked-list has an end?

639


Why Pointers are not used in C++?

612


What is malloc in c++?

545


What is this weird colon-member (" : ") syntax in the constructor?

534


What is the difference between global variables and static varables?

558


What is istream and ostream in c++?

584