Pourquoi peut-on également utiliser un constructeur vide?

Je lisais quelques Java récemment et suis tombé sur quelque chose (un idiome?) nouveau pour moi: dans le programme des classes avec plusieurs constructeurs, serait également toujours inclure un constructeur vide. Par exemple:

public class Genotype {
  private boolean bits[];
  private int rating;
  private int length;
  private Random random;

  public Genotype() {              // <= THIS is the bandit, this one right here
    random = new Random();
  }

  /* creates a Random genetoype */
  public Genotype(int length, Random r) {
    random = r;
    this.length = length;
    bits = new boolean[length];

    for(int i=0;i<length;i++) {
        bits[i] =random.nextBoolean();
    }
  }

  /* copy constructor */
  public Genotype(Genotype g,Random r) {
    random = r;
    bits = new boolean[g.length];
    rating = g.rating;
    length = g.length;

    for(int i=0;i<length;i++) {
        bits[i] = g.bits[i];
    }

  }
}

Le premier constructeur ne semble pas être un "vrai" constructeur, il me semble que dans tous les cas, l'un des autres constructeurs seront utilisés. Alors, pourquoi est ce que le constructeur du tout défini?

InformationsquelleAutor Ziggy | 2008-12-31