Lecture 12
16
Looping on a TreeMap
•To print the whole Dictionary, Lookup sends a toString message, invoking Dictionary         toString method (line 70)
•Subtle, since there’s no index to loop with
•Uses an Iterator object -                               Java tool custom designed for looping
•Iterator API has just two methods:
–boolean hasNext()
–Object next()