How to see if two tables/array are equal in a hash table

Hello!!

Ive created my own hash table and now i've been trying to compare two tables in where I want to see if they're equal, if not, where are the elements that are different in the array's. Can somebody give me some examples on where and how to use equals() Please???

Re: How to see if two tables/array are equal in a hash table

Why don't you post your code. Maybe something will jump out at us.

Re: How to see if two tables/array are equal in a hash table

if you have two hashtable,

Code:

`Hashtable hashTable1 = new Hashtable();`

Hashtable hashTable2 = new Hashtable();

then you can compare using,

Code:

`for (Map.Entry<Integer, Integer> htEntries : hashTable1.entrySet()) {`

if(hashTable2.containsKey(htEntries.getKey()) && hashTable2.get(htEntries.getKey()).equals(htEntries.getValue())){

System.out.println("\tKey: " + htEntries.getKey() + " Value: " + htEntries.getValue());

}

}

http://www.pointbaba.com/faq/66/how-...-table-in-java