Engineering Full Stack Apps with Java and JavaScript
Based on assumptions and facts, find the output.
Assumption: filename.txt does not exist.
Fact: FileNotFoundException is a child of IOException.
Program:
try { File file = new File("filename.txt"); Scanner sc = new Scanner(file); throw new IOException(); } catch (IOException e) { System.out.println("IOException called!!!"); } catch (FileNotFoundException e) { System.out.println("FileNotFoundException called!!!"); }