What’s the purpose of java.util.Set interface if it contains absolutely equal methods in comparison with java.util.Collection?
There is no prohibition for multi-implementing in Java, and Set realization (HashSet) could work fine without Set interfaces.
So why do we need that useless baggage?
What’s the purpose of java.util.Set interface if it contains absolutely equal methods in comparison
Share
JavaDoc describing contract of
Collection(emphasis mine):On
Set:In other words,
Setabstraction describes a (ekhem!) subset ofCollections.