hi freinds i have the following query.......
heres the code...this code is given in
scjp guide by kath sierra and berth bates pageno. 370
it says that the following code will show the following compiler error
try{
//do risky IO things
}catch (IOException e) {
// handle genral IOExceptions
}catch (FileNotFoundException ex) {
// handle just FileNotFoundException
}
compiler error :
TextEX.java:: exception java.io.FileNotFoundException has already been caught
} catch (FileNotFoundException ex ) {
my confusion is that FileNotFoundException is a subcllass of IOException so we know that an exception superclass can catch the exception of subclaas so here if its able to catch the exception of subclass then why will be there any error