This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
If you need the key-value pairs, then don't iterate over the keys and get the values. It's more efficient to iterate over the entries of the map, so that you don't have to do a lookup in the map for each key. Each entry is a key-value pair. For example:
About Campbell's remark: Class Vector is a legacy collection class. It has been replaced by ArrayList since Java 1.2. There's no good reason anymore to use the old class Vector. Instead of StringTokenizer, you can use the newer and more convenient class Scanner.