Ist es eine gute Übung, dass der Konstruktor eine Ausnahme auslöst?

Ist es eine gute Praxis, der Konstruktor eine exception werfen?
Zum Beispiel habe ich eine Klasse Person und ich habe age als sein einziges Attribut. Jetzt
Ich Stelle die Klasse als

class Person{
  int age;
  Person(int age) throws Exception{
   if (age<0)
       throw new Exception("invalid age");
   this.age = age;
  }

  public void setAge(int age) throws Exception{
  if (age<0)
       throw new Exception("invalid age");
   this.age = age;
  }
}

InformationsquelleAutor der Frage ako | 2011-05-22

Schreibe einen Kommentar