+ 1
Why do we need Setters and getters when we can use "=" and "return"?
Function of set & get
3 Answers
+ 5
to protect private data from being accessed / modified directly.
https://code.sololearn.com/WuswYAzn9MWs/?ref=app
0
Thank you very much Gordon
0
Una de las bases principales de la POO es la encapsulaciĂłn, los setters y getters cumplen parte de esa funciĂłn. Investiga mĂĄs sobre la POO y sus beses. Saludos.