








Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!









rd
th
th
Write a program that, given a filename for a text file as input, calculates the frequencies ( i.e. , number of occurrences) of each distinct word of the file. The program should then print the frequency distribution to the console as a sequence of “word: freq” pairs (one per line).
public interface Iterator
public class WordScanner implements Iterator