Java - Exception Handling
What is the problem with the following Java method?
public void readFile() {
throw new FileNotFoundException("File missing");
}What is the problem with the following Java method?
public void readFile() {
throw new FileNotFoundException("File missing");
}FileNotFoundException is a checked exception and must be declared or handled.throws FileNotFoundException, so compilation error occurs.throws. -> Option B15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions