OO conversion of the K&R word counting program to Java