Reading console input and writing console output in Java code example Example: java taking console input String str = System.console().readLine();