Question: how try catch finally works in java?
Answer: Flow of control in try/catch/finally blocks: If there is no exception occurred in the code which is present in try block then first, the try block gets executed completely and then control gets transferred to finally block (skipping catch blocks). If a return statement is encountered either in try or catch block.