When class members are labeled as private, they are inaccessible outside the class, enforcing _______. 

  • encapsulation 
  • abstraction 
  • polymorphism 
  • inheritance
Encapsulation is a key concept in object-oriented programming where the internal details of a class are hidden and only specific functionalities are exposed. Making class members private enforces this encapsulation.
Add your answer
Loading...

Leave a comment

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