What is collection,Collection and Collections ?

■ collection (lowercase c), which represents any of the data structures in
which objects are stored and iterated over.
■ Collection (capital C), which is actually the java.util.Collection interface
from which Set, List, and Queue extend. (That's right, extend, not implement.
There are no direct implementations of Collection.)
■ Collections (capital C and ends with s) is the java.util.Collections class
that holds a pile of static utility methods for use with collections.

SortedMap, Hashtable, HashMap, TreeMap, and
LinkedHashMap are all thought of as collections, none are actually extended
from Collection-with-a-capital-C.

No comments:

Post a Comment