how to take iunput using scanner fro string code example Example: taking string input in java Scanner in = new Scanner(System.in); String s = in.nextLine();