concept console in category functional programming

This is an excerpt from Manning's book Functional Programming in Java: How functional techniques improve your Java programs.
No printing to the console or to any device
This is very neat and safe. No bad things can happen; no exceptions can be thrown. This is the beauty of functional programming: you have a program that will always work, whatever data you use as input. But the question is, how can you use this result? Suppose you want to display the result on the console—how can you do this?
To see your new methods in action, use the following Console class.
![]()
As an example, you’ll read data from the console in a way that, although imperative, allows testing by making your programs deterministic. The approach you’ll use is similar to what you did with the random generator in chapter 12.