Equals method benifit for hashtable implementation in java?
<p>For the benefit of hashtable we have two methods  hashcode and equals.Internally when we add a key value pair in hastable first it goes inside hashcode method of key  and checks if it is equal to hashcode value of any previous key. If it is not then it simply add key value pair in hashtable but if if it is equal then it goes inside qual method of key where we provide again some logic to check if the objects are equal.So my Question here is the work we are doing in equals method we can eliminate that and put the same kind of logic inside hashcode method where we provide different hashcode (depending upon the logic we are putting in equals method). In that way we can manage the hashtable with hashcode mthod only and eliminate the need of equals method. </p>

<p>Take the example of Employee class where we have id,salary and name as its state.We are using Employee  as key in hashtable. So we override the hashcode in a way that suffice the need of hashcode and equals method both.So need of equal method.</p>

<p>I know i am missing some thing here .Looking for that miss.</p>
