[Solved] Count number of times string appears in a file
Your program is not “stuck”, it is waiting for you to enter the “user input” (again). You keep calling returnUserInput() inside the loop, and it calls getUserInput(), which will wait for you to type (another) string and press Enter. As for your code, don’t declare line as a field. It should be a local variable. … Read more