QUOTE(1lacca @ 10 Oct, 2007 - 08:22 AM)

I meant what do you treat as a word: consecutive letters separated by anything that is not a letter, or digits count, too, etc. You should not only look for spaces, but for things like :,.;:, etc. and tabs, so on. Also, if there are several spaces after eachother, they don't surround a word.
There are generally two ways to accomplish this:
a ) use the Character.isLetter and Character.isDigit functions with a primitive statemachine (a boolean variable named isInWord maybe)
b ) or create a regexp with a well crafted Pattern and Matcher (this might very well be an overkill for your assignment, but proove very useful later)
you think i don't want do that? i treat only letter as word, my teacher said I can't use anything beside the thing i learn, it's stupid.