0

what is the setter-getter?

plz anyone explain

22nd Feb 2017, 6:17 AM
ishtiaq sushmoy
ishtiaq sushmoy - avatar
3 Answers
+ 2
Setter is a method in a class to set a class member value which is hidden from outside. Getter is a method which returns class member value.
22nd Feb 2017, 8:44 AM
TamĂĄs Barta
TamĂĄs Barta - avatar
0
getColor(){ return color; } String color; setColor(String blue){ color = blue }
22nd Feb 2017, 6:22 AM
derek
0
All class member should be private. But if you want to manipulate these members (for example from another class) you need some getter and setter methods which will manipulate or return these values. Getter: get the member's value Setter: set the member's value
22nd Feb 2017, 4:08 PM
orsi