As far as I know, exceptions that are not subclasses of runtime exception or error should be caught (handled).
When a file exception occurs, it should be caught because its a subclass of exception class, but how can it be recovered? If file is not found,it sounds silly to recover it when the program has to read file to run,I think the program should be terminated.
} catch (IOException e) {
e.printStackTrace();
System.exit(0);
} finally {
if(in != null)
in.close();
}
I preferred to exit in catch block,what should be done in such a situation?