Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Word Count Method?

807600Nov 1 2007 — edited Nov 2 2007
Hey all. I am having a bit of an issue. I need to write a program to read a file and count how many words are in the file. So far I have the basis for the while loop to read a line from the file, but I can't seem to figure out how to code the loop to count the words. Java doesn't have a word count method does it? I have looked, but have been unable to find anything of the sort.

I don't want you do do this for me, I just need some helpful hint/tips. Anything you can provide is appreciated. Thanks!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 30 2007
Added on Nov 1 2007
24 comments
650 views