In Object-Oriented Programming, what is the concept of encapsulation used for?

  • Adding comments to code
  • Hiding implementation details
  • Using inheritance for code reuse
  • Writing efficient algorithms
Encapsulation in Object-Oriented Programming is used to hide the implementation details of a class. It provides data protection and restricts direct access to an object's internal state, promoting information hiding and data integrity.
Add your answer
Loading...

Leave a comment

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