Top "Getter-setter" questions

Public mutator methods in object-oriented programming, responsible for changing and returning the value of private class members, thus keeping with the principle of encapsulation.

Cross-browser Getter and Setter

This works in modern Chrome/Firefox/Opera but fails in IE8. Haven't tried it in IE9. How can I make …

javascript internet-explorer cross-browser getter getter-setter
Why use getters and setters in JavaScript?

I know how getter and setter work in JavaScript. What I don't understand is why we need them when we …

javascript getter-setter
unexpected return value when computing average?

I am having trouble being able to return the value of the "average" variable in my getter method. I keep …

java getter getter-setter bluej
Why do PHP magical methods have to be public?

I use magical methods in my PHP classes but when i try to put them private, I'm warned : WARN: The …

php getter-setter phpdoc public-method
usage of property vs getters/setters in business classes

When dealing with buisness classes, like the typical Customer and Employee classes, is it better to use getters and setters …

delphi properties getter-setter coding-style
getters and setters style

(Leaving aside the question of should you have them at all.) I have always preferred to just use function overloading …

c++ oop getter-setter
What are the differences amongst Python's "__get*__" and "_del*__" methods?

I just started learning Python a few months ago, and I'm trying to understand the differences between the different __get*__ …

python getter-setter standard-library accessor
Does modifying the result of a getter affect the object itself?

I have a question about using getter methods in java. Suppose I had this class: class Test { private ArrayList<…

java arraylist getter-setter
Getters and Setters. Is there performance overhead?

I have a Particle System Engine in my C++ project and the particles themselves are just structs of variables with …

c++ performance getter-setter
Unit testing accessors (getters and setters)

Given the following methods: public function setFoo($foo) { $this->_foo = $foo; return $this; } public function getFoo() { return $this->_…

php unit-testing phpunit accessor getter-setter