Question 10
Back to Exercise
How do const member functions support encapsulation?
- A They make the class faster
- B They guarantee an object can be read through a const reference without being modified Correct
- C They hide data members
- D They prevent inheritance
Correct Answer: Option B
Functions can then accept const T& parameters, granting read-only access safely.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!