You are welcome.
Type: Posts; User: Norm
I am glad you have it working now.
What happened with that code?
The variable should be declared in the wordsOfLength method, just like the split variable. That is where it is filled and returned.
Using global static variables is a bad solution.
savedWords is a new String that will be filled with the found words and returned by the method that finds the words.
The newWord is what is found in the search for the word that has the desired...
Build a String with the words separated by spaces: savedWords += newWord + " "
Return that String to the caller.
How are the word supposed to be returned?
All in one String separated by spaces
In an array(or ArrayList) of Strings
One String at a time requiring that the method be called one time for each...
Ok, what does the program need to do with the word it finds? Look at the reason the program is being written:
When the program finds a word, what does it need to do?
What is the program counting? What is 11 a count of?
What should the program do when it finds a space?
Ok start with that one. How should the program do that?
In the code: where is the length of the first word saved? Did you print it out to see if it was correct?
How are you trying to debug the code to see what it is doing?
Add some print statements that print out the values of variables as they are changed and used
and also to see where the code's...