In C++, _______ is used to restrict access to class members and maintain encapsulation. 

  • public 
  • protected 
  • private 
  • global
The "private" access specifier in C++ restricts access to class members, ensuring they can't be accessed or modified outside the class, thereby maintaining encapsulation and data integrity within the class.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *