Champion, I definitely agree that in real life, it is pretty useful to have other constructors... in some cases. Here's what I think: if you have to protect your API and hide a particular implementation (like, you have a RepositoryException, and the data can come from an Oracle database or from an XML file), then it is a good idea to have at least a constructor like RepositoryException(Throwable cause). But sometimes, the exception is going to start from a particular condition. In our case, we have to analyze if a record matches a particular search criteria. If no records match, then the exception is going to start there, and we don't really have to wrap other exceptions... so, in this case, I guess it really isn't necessary. Some exceptions of the
Java API only have these two constructors (see the ClassCastException, for instance). Another thing, I'm not really sure if we are allowed to provide other constructors. Even though the instructions do not say that we can't, I myself only provided these two constructors.
Cheers, Roberto Perillo
SCJP, SCWCD, SCJD, SCBCD