The System.out.println()
is executed after the hello.getMessage()
. You can check it with the debuger.
1)preRunMessage()
2)hello.getMessage()
3)postRunMessage()
4)the System.out.println() prints the string returned by hello.getMessage()
Try to print something in hello.getMessage()
, it will be printed between pre and post RunMessage methods.