What is the main principle of Object-Oriented Programming (OOP)?

  • Abstraction
  • Encapsulation
  • Inheritance
  • Polymorphism
Encapsulation is one of the main principles of Object-Oriented Programming (OOP). It refers to the bundling of data (attributes) and methods (functions) that operate on the data into a single unit or class. Encapsulation helps in hiding the internal complexities of an object and allows access to only the necessary parts through well-defined interfaces. This concept promotes modularity, reusability, and easier maintenance of code in OOP.
Add your answer
Loading...

Leave a comment

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