Before return "A" the finally block will be called, which will be return "B" , and your return "A" will be skipped and will never be executed. Its because the finally block is always executed before the return method, and if you return something from the finally block, the return your try/catch will always be skipped.
Note. Returning from the finally block is not good practice for a Java programmer. The JAVA Compiler also shows you a warning, because the " finally block does not complete normally " if you are returning something from the finally block.
source share