how to take input a string in java 8 code example Example: java taking console input String str = System.console().readLine();