I will type first the problem
"Let the user Enter a Sentence. then determine the longest word(s) in that sentence "
ex.#1 Input (Who is john galt ? )
output (john galt )
ex.#2
Input (Lets get jiggy with it)
Output (jiggy)
I already made a process for getting the longest words and outputting it..
The Only problem I can't solve for now.. is that I can't store The words in an array
This is what I have in mind
for(x=0;x<a.length();x++)
{if(a.charAt(x)!=' ')
{
iba[y]+=a.charAt(x);
}
else if(a.charAt(x)==' ')
{y++;}
but I always encounter an error
ArrayIndexOutOfBoundsException error
can you help me store the words in an array?