|
Code:
|
while(input.hasNext())
{
String s1 = input.nextLine();
// WHAT? what are you trying to do?
chars = s1.toCharArray(s1.split(" "));
}
for(int i=0; i<chars.length; i++)
{
// err... no you can't compare a char to a string.
if(chars[i] == "John")
// no such method for chars
chars[i].replaceAll(chars[i],"");
} |
WHAT? what are you trying to do?
im trying to put each word in an array, i guess that is not a correct way.
// err... no you can't compare a char to a string.
If i successfully puting each word in an array i would comparing a string to string. i guess that failed too.
// no such method for chars
thanks! now i know =]