Possible Duplicate:
Why use getters and setters?
I know this is very trivial. But why do we define private and then we use getter and setters. Is this more like for preventing the programmers from making mistakes on using private variables or methods? Or is it for security reasons. If for security reasons then what is the point of having getters or setters? I know that we can have restrictions inside getter and setter but those if clauses are mostly for preventing the mistakes not the privacy restrictions. E.g. we don't usually say for these members limit the access to this method with an if clause.
Thanks.