Collections.synchronizedCollection()
807607Dec 2 2006 — edited Dec 2 2006Hi, 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!