I have tried to do a for each loop but i can't get it to work. The closest i have got is for an error to appear saying cannot find symbol when i type in a word.
Below is what i have done at the moment, spent hours and hours doing it and feel as if i am getting nowhere. Its meant to search the arraylist for the word entered and return true if the word exits but mine does not seem to be searching the array list properly. I would be grateful for any hints or help you could give me thank you
public boolean isKnownWord(String word)
for( String word : words)
Page 1 of 1
3 Replies - 1597 Views - Last Post: 02 November 2006 - 11:04 AM
Replies To: For each loop need help please
Re: For each loop need help please
Posted 02 November 2006 - 06:52 AM
Is the arraylist global? Because you're not passing the method the array list, only a single word.
I don't know how to go through one word at a time, i have no idea. What do u means is it global? I got given a list of words called words.txt and i have a DictReader as another class. But in this Spellchecker class i can't get it to find the word. Does what i have written made sense?
Page 1 of 1