Originally posted by raminaa niilian: Hi thank you for reading my post how i can get all elemets of a hashtable without knowing the hashtable key values ? i tried with those enumeration stuff with no luck.
Well, you have many options...
1. You can get an enumeration of the keys (with keys()), enumerate through those keys to get the matching values.
2. You can get all the key / values pairs in a set (with entrySet()), iterate through the set.
3. You can get all the keys in a set (with keySet()), iterate through those keys to get the matching values.
You can also get an enumeration of the values (with values()), but that is not very useful if you want the key / value pairs. I would recommend either option 2 or 3, as enumerations are not used much anymore.