Java Foundations — Question 27

Which statement is true about a mutator method?

Answer options

Correct answer: B

Explanation

The correct answer, B, is true because a mutator method is designed to modify the values of instance members. Options A and C are incorrect as mutator methods do not replace constructors or need to be private, and option D, while partially true, does not accurately describe the primary function of mutator methods.