1.
What is one use of data encapsulation?
- To wrap up a sequence of code in a function.
- This is one use of functional encapsulation, not data encapsulation.
- To hide implementation details from users or programmers that don’t need to know them.
- Data encapsulation is the separation of the implementation of data from the interface of a structure.
- To keep all data in a container like a vector.
- This is not related to encapsulation.
- To make all data public and accessible to everyone.
- Data encapsulation is based on the idea that each structure should prevent unrestricted access to internal representation.