37.6k views
0 votes
What is the purpose of a mutator?

1 Answer

4 votes

Answer:

To change the value of private or protected members.

Step-by-step explanation:

Mutator also known as setters are the member function or method in class that is used to set or change the value of private or protected members. Mutator does not return any values. They are very important in Object Oriented Programming.

User Esmir
by
6.9k points