printStackTrace()
outputs to standard error. System.out.println("common")
outputs to standard output. Both of them are routed to the same console, but the order in which they appear on that console is not necessarily the order in which they were executed.
If you write to the same stream in both catch block and finally block (for example, try System.err.println("common")
), you'll see that the catch block is always executed before the finally block when an exception is caught.