+ 1

What is difference between getters/setters and constructors?

24th Sep 2017, 12:00 PM
akash
2 Answers
+ 14
Constructors create the object and assign initial values to the attributes. Setters alter the value of attributes after the object has already been created. Getters return the value of attributes.
24th Sep 2017, 12:06 PM
Tashi N
Tashi N - avatar
+ 2
If you want to sound really smart call the getters accessors and the setters mutators.
24th Sep 2017, 12:30 PM
Arthur Tripp
Arthur Tripp - avatar