Hello All,
I really hope that someone can provide some assistance.
I have read a XML file into my hashtable. Next I created a second hashtable. If a key is located in my first hashtable, I want that key along with its value to be inserted into the second hashtable.
For example the code below: if hash contains the key "info" put the key "info" along with its value into hash2. However when it it displayed I want to display the value, which is the description.
for(int i = 0; i < 7; i++)
{
if(hash.containsKey(hash.get(info)))
{
hash2.put(hash.t.car[i].getName(),
hash.t.car[i].getDescrip());
}
}
This is done so when I try to remove a key I can just test for the key "info" and remove the value, which is description.
if(hash2.containsKey(info) )
{
hash2.remove(info);
}
The problem is that when I try to "put" items into the hashtable they simply will not go into the hashtable. What am I doing wrong?
Any assistance will be greatly appreciated.
Thanks