string user input in java code example Example: taking string input in java Click to copyScanner in = new Scanner(System.in); String s = in.nextLine();