Implement wc

Implement the Unix command wc to count the number of words in a file.

No need to implement the opening of a file reference, assume that you have already been passed the text of a file:


Answers are hidden from search engines.
language=java unix string algorithm coding