Executes after the return statement executes before the method return action, and if finally there is a return statement, the method returns as a finally return, and if there is no return statement in Finally, Then this method returns as the return of the try.P:The return value of the method is based on the result of the last execution of the return statement, and once the return value is determined, it does not affect subsequent code execution.Test procedure:public static void Main (string[] args) {System.out.println (test ()); System.out.println ("Finish.."); }private static int Test () {int b = 20; try {System.out.println ("try block"); return B + = 80; } finally {System.out.println ("finally block"); if (b >) {System.out.println ("b =" + B); }//If this line cancels the comment, seeInput 2。 return 1; If this line cancels the comment, seeOutput 3。 B--; The return value of the method is determined before finally (it can be understood that each method has a memory space to hold the return value), and modifying B here does not affect the return value. } }Output:Try blockfinally blockb = 100100finish..Output 2:Try blockfinally blockb = 1001finish..Output 3:Try blockfinally blockb = 100100finish..
Java-Will the finally execute if there is a return statement in the try? Before or after the return?