Lecture 12
18
• while ( wordIterator.hasNext() ) {
•    word = (String)wordIterator.next();
•    definition = this.getEntry( word );
•    str += word + ":\n" +     definition.toString() + "\n";
• }
•hasNext() returns false when at end of list
•next() returns a reference to the next Object in the list
•cast that to a String since that’s what the key is
Using an Iterator