PRINT

object PRINT : Redirect

Redirect the stream to this process equivalent one. In other words, it will print to the terminal if this process is also doing so.

This is correctly using System.out or System.err depending on the stream + preserving the correct order.

See also

when you want to have full control on the outcome.