Self encapsulate fields

Within the implementation of a class, it's common to refer directly to private fields. There is another style, in which all internal references to fields are indirect, and proceed through the appropriate get and set methods. This is called self-encapsulation.

Self-encapsulation:

Example
public final class Infant {

  public Infant (final String name, final int weight, final String mood){
    setName(name);
    setWeight(weight);
    setMood(mood);
  }

  public void becomeHungry(){
    //instead of fMood = "Cranky", use:
    setMood("Cranky");
  }

  public String toString(){
    //use get methods instead of direct access
    final StringBuilder result = new StringBuilder();
    result.append("Infant - Name: + ");
    result.append(getName());
    result.append(" Weight: ");
    result.append(getWeight());
    result.append(" Mood: ");
    result.append(getMood());
    return result.toString();
  }

  public String getName(){
    return name;
  }
  public void setName(String name){
    this.name = name;
  }

  public int getWeight(){
    return weight;
  }
  public void setWeight(final int weight){
    this.weight = weight;
  }

  public String getMood(){
    return mood;
  }
  public void setMood(final String mood){
    this.mood = mood;
  }

  //..other methods elided

  // PRIVATE
  private String name;
  private int weight;
  private String mood;
} 

See Also :
Lazy initialization