Question: are getters and setters necessary?
Answer: Getters and setters are used to protect your data, particularly when creating classes. For each instance variable, a getter method returns its value while a setter method sets or updates its value. ... Getters and setters allow control over the values.