Written by the Fiveable Content Team โข Last updated September 2025
Verified for the 2026 exam
Verified for the 2026 examโขWritten by the Fiveable Content Team โข Last updated September 2025
Definition
Mutator methods, also known as setters, are methods in object-oriented programming that allow the modification of an object's attributes or properties. They provide a way to update the values of private instance variables within a class.
Parameters are variables used in method declarations to represent the data that needs to be passed into a method. They act as placeholders for actual values when calling a method.
Pass-by-value is a mechanism where copies of values are passed into methods or functions. When using pass-by-value, any changes made to the parameter inside the method do not affect the original value outside of it.
Accessor Methods (Getters): Accessor methods, also known as getters, are methods that retrieve or return the current value of an object's attribute or property. They provide access to private instance variables without allowing direct modification.