java.util.Collection and java.util.Set interfaces -



java.util.Collection and java.util.Set interfaces -

what's purpose of java.util.set interface if contains absolutely equal methods in comparing java.util.collection? there no prohibition multi-implementing in java, , set realization (hashset) work fine without set interfaces. why need useless baggage?

javadoc describing contract of collection (emphasis mine):

a collection represents grouping of objects, known elements. some collections allow duplicate elements , others not.

on set:

a collection contains no duplicate elements.

in other words, set abstraction describes (ekhem!) subset of collections.

collections

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -