Setters are similar to getters in that they’re syntactic-sugar for methods . But, setters don’t provide read-access to a variable. They’re used to set the value of a variable and nothing else.
Setters are similar to getters in that they’re syntactic-sugar for methods . But, setters don’t provide read-access to a variable. They’re used to set the value of a variable and nothing else.