Encapsulating the data with getters can provide several advantages, including:
- You can change the field to some other representation, without affecting callers.
- You can add additional code in the getter.
- You can implement an interface that provides the getters.
- You can provide read-only access to the fields even if they weren't
final
.