When thinking about this,
you should always think about a case where an exception could 'slip through' the try catch net. It should never be possible.
e.g. If a parent has a method 'a' that throws a FileNotFoundException , then
it can not have a child that overides that method 'a' and that throws an
exception that is broader than its FileNotFoundException (broader than
FileNotFoundException is e.g. IOException because FileNotFoundException
extends IOException). Why not ? Because of
polymorphism. One could easily
write Parent p = new Child(); and if somebody would call that method 'a' on
p, then a try{}catch(FileNotFoundException){} would have to be done. And if
the child would be able to throw an IOException (like HttpException), then
the parent's try catch would not suffice. Therefore it can not be allowed.
If the child overides the method 'a' and choses to throw a subclass of the
parents exception or nothing, then there is never a problem since the
FileNotFoundException would always catch that.
[ November 08, 2007: Message edited by: Mark Uppeteer ]
long line edited
[ November 09, 2007: Message edited by: Burkhard Hassel ]