What is a mutator method?
-
A getter function
-
A setter function
-
A constructor
-
An overridden method
B
Correct answer
Explanation
A mutator method, commonly known as a setter, is used to modify the state of an object by changing the value of its private fields.