#362 Return Priority in finally

Companies:
Elesta
Themes:
JavaExceptionsCode Review

What does the method return?

public static int test(){
    try {
        int g = 3 / 1;
        return 1;
    } catch (ArithmeticException ae) {
        return 2;
    } finally {
        return 3;
    }
}

Question review

Mentor
Answer as you would in a real interview. I’ll ask follow-up questions, then compare your answer with the reference answer and show your accuracy as a %.
Sign in to start the dialogue The mentor keeps the context of the current question and your previous messages.
Sign in