0

accessor method and mutator method

public class CashRegister { private double purchase; private double payment; . . . } ====================================================== which one is an accessor method and a mutator method in this case ?

22nd Jul 2020, 8:01 AM
jjkc
jjkc - avatar
3 Respostas
+ 2
Accessor" and "Mutator" are just fancy names for getters and a setters. A getter, "Accessor", returns a class's variable or its value.
22nd Jul 2020, 8:17 AM
Aayush $aini
Aayush $aini - avatar
+ 1
They are the methods not variables
22nd Jul 2020, 9:00 AM
Aayush $aini
Aayush $aini - avatar
0
so whiche one i sa getter and which one is setter in this case?
22nd Jul 2020, 8:54 AM
jjkc
jjkc - avatar