خرید بک لینک

Vote count: 0

This is more of a design question in which I am curious as to why the HashSet does not support put like operation with the add.

If I want to update an object with equal hashCode as an existing object I have to do this:

hashSet.remove(o);
hasSet.add(o);

I think a

hashSet.add(o);

should have sufficed since it uses a HashMap under the hood anyway.

asked 39 secs ago

برچسب: نویسنده: استخدام کار تاريخ: پنجشنبه 14 مرداد 1395 ساعت: 17:44

صفحه بندی