a guest Jan 12th, 2017 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let's say I create hashset<employee> set = new hashSet();
  2. employee e1 = new employee("adithyan",1);
  3. employee e2 = new employee("santhosh",1);
  4. employee e3 = new employee("pavan",2);
  6. set.add(e2); -- let's say e1 and e2 hashcode are same and value gets stored in same bucket and if I do search on id=1, how it will search because e1 and e2 hashcodes are same, probably e1 and e2 would be stored in same bucket, what would be the result for this?
  8. I am confused with bucketing which has more than one objects along with objects has same data(let's say  bucket1->,, in this case hashcode will be the same because  both objects are in same bucket, I don't know how searching would work!
  10. can somebody explain how hashset uses hastable with same hashcode and bucketing concept?
RAW Paste Data