System.out.println() first prints the message, then the new line. Between these two calls, the client might print a message, breaking formatting. Instead, call System.out.print() with '\n' appended to the message.