Asked by Lungelo Cebekhulu on Sep 27, 2024
A set method is:
A) an accessor method
B) a mutator method
C) a recursive method
D) none of the above
Set Method
A set method in object-oriented programming is a method that updates the value of a private field in an object.
Mutator Method
A method used to control changes to a variable, often referred to as a setter in object-oriented programming.
Recursive Method
A method in programming that calls itself in order to solve a problem by breaking it down into more manageable subproblems.
- Distinguish between accessor and mutator methods and their purposes.
Learning Objectives
- Distinguish between accessor and mutator methods and their purposes.