InterviewSolution
| 1. |
Write About The Access Privileges In C++ And Also Mention About Its Default Access Level? |
|
Answer» There are THREE access privileges PROVIDED in C++ which are private, protected, and public. The members of a class have private access by default.The public members can be accessed by member FUNCTIONS and by other functions that declare an INSTANCE of the class. The private members can be accessed by member functions of the same class. The protected members are included by using the class inheritance. The protected members can be accessed only within the class. There are three access privileges provided in C++ which are private, protected, and public. The members of a class have private access by default.The public members can be accessed by member functions and by other functions that declare an instance of the class. The private members can be accessed by member functions of the same class. The protected members are included by using the class inheritance. The protected members can be accessed only within the class. |
|