Take this piece of code:
try
{
FileReader f=new FileReader("D:/sda.t");
}catch(FileNotFoundException e)
{
e.printStackTrace();
}catch(Exception f)
{
f.printStackTrace();
}
- Why do we follow this approach?
- Why don't we just use Exception objection to catch all exceptions rather going for specific ones?