Page 1 of 1

About Question com.enthuware.jfcja.v8.2.418 :

Posted: Sun Sep 17, 2023 4:05 pm
by Veilok
"They allow setting and retrieval of private data elements of an instance"
"Accessor methods means the methods that modify or read the instance data fields of a class. Conventionally, the method that reads the field named xxx is named getXxx and the method that sets its value is named setXxx. That is why, accessor methods are also known as getters and setters."

Isn't it true that accessors retrieve data from an object, while mutators modify or set data in an object?

Re: About Question com.enthuware.jfcja.v8.2.418 :

Posted: Sun Sep 17, 2023 11:25 pm
by admin
Yes, that is true. Technically, accessor == get and mutator == set.
Generally, people (although incorrectly) use the term accessors for both.