LogiQuest
Back to Exceptions
12

What is the output of the following program?

public class Main {
    static int g() {
        try { return 1; }
        finally { return 2; }
    }
    public static void main(String[] args) {
        System.out.println(g());
    }
}
Hard

Discussion (0)

  • No discussion yet. Ask a doubt or share a shortcut.

Log in to join the discussion.