C++ Programmer Question:

Download Job Interview Questions and Answers PDF

Explain me what do you mean by C++ access specifiers?

C++ Programmer Interview Question
C++ Programmer Interview Question

Answer:

Access specifiers are used to define how the members (functions and variables) can be accessed outside the class. There are three access specifiers defined which are public, private, and protected
☛ private:
Members declared as private are accessible only with in the same class and they cannot be accessed outside the class they are declared.
☛ public:
Members declared as public are accessible from any where.
☛ protected:
Members declared as protected can not be accessed from outside the class except a child class. This access specifier has significance in the context of inheritance.

Download C++ Programmer Interview Questions And Answers PDF

Previous QuestionNext Question
Please explain what is difference between shallow copy and deep copy? Which is default?Tell us does C++ supports exception handling? If so what are the keywords involved in achieving the same?