Search:

Type: Posts; User: GregBrannon

Search: Search took 0.17 seconds.

  1. Re: Program to find the number of occurrences of words in the text file

    Now also posted here.
  2. Re: Program to find the number of occurrences of words in the text file

    Can you see that the correct answer is there, but the output is "wrong"? And the output isn't really wrong, but it includes test code that you used to improve your program. I think you can remove...
  3. Re: Program to find the number of occurrences of words in the text file

    And what does "not working perfectly" mean? Show a sample run as you've done before and what is incorrect with it.
  4. Re: Program to find the number of occurrences of words in the text file

    If the statement:

    if (words[j + 1].equals(word))

    is causing the error (as it was in your first post), then ensure that j + 1 does not exceed the array's number of elements - 1. How could you...
  5. Re: Program to find the number of occurrences of words in the text file

    Don't create a new Scanner object each time you need to get input. The object scan can be used both times.

    I see that this line will most likely cause an error each time it is run:

    if (...
Results 1 to 5 of 5