Chapter 11: Problem 3
Why is an object's internal data usually hidden from outside code?
Short Answer
Expert verified
Answer: An object's internal data is typically hidden from outside code to ensure data integrity, promote clean and maintainable code, provide flexibility in code design, and encourage code reusability. This practice is known as encapsulation and helps maintain a consistent state of objects, protecting them from unintended modification or corruption.