Chapter 1: Problem 27
What is encapsulation?
Short Answer
Expert verified
Answer: Encapsulation is a principle in object-oriented programming (OOP) that involves bundling data and methods within a single unit called a class, allowing better control and management of the data. The purpose of encapsulation is to achieve abstraction, hide the internal workings of a class, increase modularity, enhance code maintainability, and improve security by restricting access to sensitive data.