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?

Answers were Sorted based on User's Feedback



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

Answer / koushik k reddy

Private:
It cannot be accessed by object and cannot be inherited, will be used only by the member functions of the class
Protected:
It cannot be accessed by the object and used by the member functions of the class can be inherited to first level of inheritance
Public:
It can be accessed by the objects and can be inherited to any level

Is This Answer Correct ?    1 Yes 0 No

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

Answer / kalpana.y


Private is used for intialization of variables
eg:
int p,r;
public is used for function name
eg:
void display();
protected is used for void main()

eg:
void main()
class c;

Is This Answer Correct ?    24 Yes 86 No

Post New Answer

More C++ General Interview Questions

When do you call copy constructors?

0 Answers  


what is the basic concept of c++(object oriented programing)

4 Answers   Wipro,


How to stop conversions among objects?

5 Answers   Symphony,


Write any small program that will compile in "C" but not in "C++"?

4 Answers  


Explain the difference between c++ and java.

0 Answers  


What is a virtual destructor? Explain the use of it?

0 Answers  


Difference between an inspector and a mutator

0 Answers  


What is encapsulation in c++?

1 Answers  


Why do we need c++?

0 Answers  


What is the difference between the functions memmove() and memcpy()?

0 Answers  


What is the use of lambda in c++?

0 Answers  


In a class only declaration of the function is there but defintion is not there then what is that function?

5 Answers   Hughes,


Categories