This has already been answered here:
Java: System.out.println and System.err.println out of order
This happens because your finally clause is using System.out and the other code is using System.err. The err stream is flushing out prior to the out stream or vice versa.
As a result, the order of printed data will not be guaranteed to come out in the same order that it is called.
You can always have your console direct the err stream to a file or the out stream to a file for later inspection. Or, change your code to print everything to System.out. Many programmers do not use err and the usefulness is debatable unless you capture err separate from the console.
Just use out!
Over and out...