how to read input through console in java code example Example: java taking console input String str = System.console().readLine();