Hi, Im storing vectors in a hashtable. The key is an unique name. How do I get the value without using the keyname like: Integer n = (Integer)numbers.get("two"); (numbers is the ht). I would like to key #1, and then key#2 etc. Simple put. Im want to get all my information out of my ht, but Im dont know how. Every code Ive found is depending on that your are aware of your keyname.
The Javadoc APIs are your friend. Have a look at the method keys(), which returns an Enumeration of all the keys in the Hashtable. Better (but more complicated and a bit harder for the novice to understand) is the entrySet() method, which returns a Set full of Map.Entry objects, each one of which contains a single key and a single value from the HashMap.