Data encapsulation in programming
What is the concept of data encapsulation in programming?
Answer
Data encapsulation is a fundamental principle in object-oriented programming that restricts direct access to an object's data, allowing it to be accessed only through defined methods. This promotes data hiding and protects the integrity of the object's state.