The terms were selected because their programming use closely mirrors their English definition. Refer to this simple class:
Code:
public class Foo {
private String bar;
public Foo() { // <- Constructor
bar = "Default";
}
public String getBar() { // <- Accessor
return bar;
}
public String setBar( String differentBar ) { // <- Mutator
this.bar = differentBar;
}
}
public class TestFoo {
public static void main( String[] args ) {
Foo foo; // #1
foo = new Foo(); // #2
System.out.println( foo.getBar() ); // #3
foo.setBar( "foobar" ); // #4
System.out.println( foo.getBar() ); // #5
}
}
At item #1 we've said "I'm going to want a Foo". But we don't actually
have a Foo yet. It's like having an empty lot where a custom house will go. At it's most fundamental, the Object "Foo" occupies enough memory on your computer to hold however many characters you put into "bar" (plus a bit of overhead). There's room for it, but it's not there yet. (That's actually somewhat inaccurate, but close enough)
At item #2 we call the "Constructor". That actually
makes a Foo. Basically the construction crew has come to your lot and built your house. Prior to this it was only a concept - a "Foo like house". Now it is there.
At items #3 & 5 we use the "accessors". We are "accessing" information that's inside of the Foo. It's leaving a Window uncovered in your new house's living room so the neighbors can see your clock. They can't
touch the clock, but they can see the time. They can "access" the time.
At item #4 we use the "mutator". This is analogous to leaving the door unlocked so the neighbor can come in and adjust the time or even replace the clock. We are making a change - and since "changor" sounds too goofy (

), we use "mutator". Actually, we are mutating the object to look different.
HTH