Answer
A setter is a method used to change the value of an attribute and a getter is a method used to get the value of an attribute. There is a standard naming convention for getters and setters, but Java compiler won't complain even otherwise.
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name=name;
}
Here getName and setName are the getter and setter for the variable 'name' respectively. Since this is a standard naming convention, many IDEs like eclipse will generate it for you in this form.