{{libheader|Console}} ===Ad hoc REPL solution=== Ad hoc solution as [http://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop REPL] script. Type this in a REPL session: println("Hello world!") ===Via Java runtime=== This is a call to the Java run-time library. '''Not recommended'''. System.out.println("Hello world!") ===Via Scala Console API=== This is a call to the Scala run-time library. '''Recommended'''. println("Hello world!") ===Short term deviation to out=== Console.withErr(Console.out) { Console.err.println("This goes to default _out_") } ===Long term deviation to out=== Console.err.println ("Err not deviated") Console.setErr(Console.out) Console.err.println ("Err deviated") Console.setErr(Console.err) // Reset to normal