Check out example codes for "iterate through hashtable java". It will help you in understanding the concepts better.

Code Example 1

//create hash table
HashTable<String , int> ht = new HashTable<>();
ht.put("first",1);
ht.put("second",2);

//create a set holding all keys in the hashtable
Set<String> keys = ht.keySet();

//iterate through with a for loop
for(String key : keys) {
 System.out.println(ht.get(key));
}  

//OUTPUT
// 1
// 2

Learn ReactJs, React Native from akashmittal.com