Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Answer Posted / krishnachaitanya narne adeesh

Public data is used to access from any where in the program
means any class or any member function can utilize those
variables and member functions.

Where as Private data will not give access to any other
classes and also for derived classes it use those variables
only on particular class only.

Here Protected is similar to Private but difference is just
it gave access to its derived classes also. This is also
opposite to Public.

Is This Answer Correct ?    46 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is rust better than c++?

1120


What are single and multiple inheritances in c++?

1103


Write about the retrieval of n number of objects during the process of delete[]p?

1022


What is meaning of in c++?

1218


What is istream c++?

1199


How can you link a c program with a c function?

1076


Is c++ a high level language?

1006


What is the difference between global variables and static varables?

1146


How can a called function determine the number of arguments that have been passed to it?

1142


What is iterator c++?

992


How many ways can a variable be initialized into in C++?

1026


What are the various access specifiers in c++?

1034


Write a function to find the nth item from the end of a linked list in a single pass.

983


What parameter does the constructor to an ofstream object take?

1060


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].

1459