Agustin John Lacson wrote:how do I loop through the map to display the person's name (key), and their corresponding birthdates?
Well, first: you need to read up on three methods provided by all Java Maps:
keySet()
values(), and
entrySet()
and then look at Aniket's post again.
You can use either of the first two styles he lists to do what you want, since they work for ANY Java collection (ListIterator only works for Lists; and I wouldn't use Enumeration at all - it's old-fashioned - although it
is worth knowing that it exists).
For your needs, I have a slight preference for using
entrySet() and a for-each loop, but that's just my opinion.
Winston