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