Java - Exception Handling
Identify the error in the following code snippet:
public void write() throws IOException {
// code
}
public void save() {
write();
}Identify the error in the following code snippet:
public void write() throws IOException {
// code
}
public void save() {
write();
}write() declares it throws IOException, a checked exception.save() calls write() but neither handles nor declares the exception.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions