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");
        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
Keep exploring
Java quizzes
Sign Up Now
or Subscribe for future quizzes