Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 1773

A methodology that enables a system to be modeled as a set of objects that can be controlled and manipulated in a modular manner

16 votes

When or why should one use getters/setters for class properties instead of simply making the...

I think you must try to use getters and setters always. In your case you have something like: obj = new Obj(); obj.prop = "1"; What if you have other 1000 references to obj.prop? And then, you deci …
Cristian's user avatar
  • 1,403