Modify the ReadBinary class from Section 10.5, Looping while file not found, so that it counts the number of words in trc_v1.data rather than printing out the first few lines. The only output from the program (except for messages in the event of an error) should be the number of words in the report. Hints:
• Unlike the readLine method of BufferedReader, the readUTF method does not return null when the end of file is reached. Instead, an EOFException is thrown.
• To count the number of words in any string, you can use a StringTokenizer object.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here