Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Collections.synchronizedCollection()

807607Dec 2 2006 — edited Dec 2 2006
Hi, Developers.

In synchronizedCollection() method api description of java.util.Collection we can see:
The returned collection does not pass the hashCode and equals operations through to the backing collection, but relies on Object's equals and hashCode methods. This is necessary to preserve the contracts of these operations in the case that the backing collection is a set or a list.


May you explain it to me. What does they mean here? Why do they want to preserver the contract? What is raisin in set or list?

Thnx!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 30 2006
Added on Dec 2 2006
3 comments
80 views