-
Please help me out
-
1. You could 'eat' it
public void bacaFile(String filename) {
try {
File f = new File(filename);
//other ops here
} catch (IOException e) {
}
}
2. You can throw it
public void bacaFile(String filename) throws IOException {
File f = new File(filename);
//other ops here
}
3. You can throw it with your own exception
public void bacaFile(String filename) throws YourDefinedException {
try {
File f = new File(filename);
//other ops here
} catch (IOException e) {
throw new YourDefinedException("File not found");
//or
//throw new YourDefinedException(e);
}
So many resources on the web that you can read about exception handling.
}