Suppose the file Hello.txt doesn't exist. Which exception will be thrown from the method readFile?

public void readFile() throws Exception {
        try {
            FileInputStream dis = new FileInputStream("Hello.txt");
            System.out.println(dis.read());
        }
        catch (FileNotFoundException fne) {
            throw fne;
        }
        catch (IOException ioe) {
            throw ioe;
        }
        finally {
            throw new Exception("Final Exception");
        }
}

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback