1. In object-oriented programming, methods used to set or assign values to the private properties or attributes of an object
The setter methods allow you to modify the object's internal state in a controlled way.
Os métodos setter permitem que você modifique o estado interno do objeto de forma controlada.
2. Functions that modify object state while potentially including validation or side effects
Good practice dictates that setter methods should validate input before assigning values.
A boa prática dita que os métodos setter devem validar a entrada antes de atribuir valores.