According to the output it seems finally was not executed despite the try block getting completed.
? line 3 of the output appears to be the message from line 23 in the finally block so it looks to me like the finally is being executed.
Be careful when reading a single output that combines System.out and System.err. They are separtely buffered, and may not appear in the same order that they were generated.
Source : https://www.daniweb.com/programming/software-development/threads/515404/finally-not-executed-after-try-block