accessor and mutator methods gets and sets

Can someone tell me how accessor and mutator methods are called? I am looking at a sample project (there are three classes and too much code to post) where the set and get methods are never called. How does the program know to go to those methods? If there is a tutorial on this that someone knows about I would appreciate it. So far everything I read on accessor and mutators just shows code without explaining how it gets there or even why you need them. Thanks.

[471 byte] By [pberardi1a] at [2007-11-27 9:51:57]
# 1
The accessor methods are always getXXX() and return value. Mutator methods are used to set certain values setXXX(<arg>). It isually sets the value to instance variables of a class. These values are read by getXXX methods.
richa2608a at 2007-7-13 0:21:11 > top of Java-index,Java Essentials,New To Java...
# 2

Here are a couple of tutorials. The general answer is that these methods are not called (see exception to this below) unless your code calls them. This first tutorial will walk you through the "HowTo" about field variables in Java. As a general rule field variables Java field variables have "private" scope, meaning that they cannot be accessed or set directly (this of course is fully based on what the programmer wants). If access to these field variables is required, "public" getter and setter methods are provided to accomplish this.

http://java.sun.com/docs/books/tutorial/java/nutsandbolts/variables.html

Of course there is an exception to the "not called automatically" rule. When using JavaBean technology, the accessor methods seem to be called more automatically. Here is a tutorial on this technology.

http://java.sun.com/docs/books/tutorial/javabeans/

kris.richardsa at 2007-7-13 0:21:11 > top of Java-index,Java Essentials,New To Java...
# 3
> When using JavaBean technology, the accessor methods seem to be called more automatically.There's nothing automagic about it. Just reflection: http://java.sun.com/docs/books/tutorial/reflect/index.html
BigDaddyLoveHandlesa at 2007-7-13 0:21:11 > top of Java-index,Java Essentials,New To Java...