Technical Discussion :: C++
Home > Freshers > Technical Interview Questions > C++
14. What is public, protected, and private?
Answer:
Ø Public, protected and private are three access specifier in C++.
Ø Public data members and member functions are accessible outside the class.
Ø Protected data members and member functions are only available to derived classes.
Ø Private Data members and member functions can’t be accessed outside the class. However there is an exception can be using friend classes.
Asked In :: iGate Accenture
Ø Public, protected and private are three access specifier in C++.
Ø Public data members and member functions are accessible outside the class.
Ø Protected data members and member functions are only available to derived classes.
Ø Private Data members and member functions can’t be accessed outside the class. However there is an exception can be using friend classes.
Ø Public data members and member functions are accessible outside the class.
Ø Protected data members and member functions are only available to derived classes.
Ø Private Data members and member functions can’t be accessed outside the class. However there is an exception can be using friend classes.