Briefly explain various access specifiers in C++.



Briefly explain various access specifiers in C++...

Answer / Atalesh Kumar Verma

In C++, there are three access specifiers: public, private, and protected. Public members can be accessed both inside and outside the class. Private members can only be accessed within the class itself. Protected members can be accessed within the class and its derived classes but not from outside the class.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ Interview Questions

What is partial specialization or template specialization?

1 Answers   Amazon,


Without using third variable write a code to swap two numbers.

1 Answers   Accenture,


What does malloc return in C and C++?

1 Answers   Alter,


Define type casting in C++.

1 Answers   Amdocs,


What is the difference between an ARRAY and a LIST in C++?

2 Answers   IBS, TCS,


Write a C++ Program to Check Whether a character is Vowel or Consonant.

2 Answers  


What is a memory leak in C++?

1 Answers   Agilent,


What do you know about Volatile keyword in C++? Explain with an example code.

1 Answers   Adobe,


What are string library functions(syntax).

1 Answers   Accenture,


What is the 4 difference between delete[] and delete?

1 Answers   Alter,


What is wrong with this statement? std::auto_ptr ptr(new char[10]);

1 Answers   Amazon,


What is the difference between creating an object, using 'new' and using 'malloc'?

3 Answers   HFG, Siemens,


Categories