Exposing a public getter for sensitive data, like a password, can lead to security issues, as it allows anyone with access to the object to retrieve the sensitive information. Instead, methods should be designed to handle authentication or encryption. For example, in a User class, rather than exposing a password, you might provide a `checkPassword()` method that verifies a password against a stored hash.
Additional Notes
Why might exposing a public getter for sensitive data be risky?