Hello All,
How can I get the information that corresponds with the containsKey to be put into the hashtable.
I am checking to see if a hashtable contains a key. If it does how can I put that key along with its value into a second hashtable.
Snippet of code:
for(int i = 0; i < 7; i ++)
{
if(hash.containsKey("elephant"))
{
hash2.put(hash.t.animals[i].getName(), hash.t.animals.item[i]getDescrip());
}
}
For example if "hash" containsKey "elephant". Search the array for elephant and "put" "elephant" and its description into hash2. The "elephant" is in .....getName() and description of the elephant is in .....getDescrip().
elephant would be the key and its description would be the value.
Any suggestions would be appreciated.
Thanks,