Advantages and Disadvantages of the Collection Framework
In this section, you will learn the
advantages and disadvantages of Java Collection Framework. A collection is simply an object that groups multiple elements into a
single unit. It is also called as a container sometimes. It is used to store,
retrieve, manipulate, and communicate aggregate data. Typically, it represents
data items that form a natural group and allows duplicate elements while others
do not. It consists of both ordered and unordered elements.
Advantages of collections
need not to learn multiple ad hoc collection APIs.
provides a standard interface for collections that fosters software reuse
and also provides algorithms to manipulate them.
the effort required to design and implement APIs by eliminating the need to
produce ad hoc collections APIs.
provides useful data structures and algorithms that reduces programming
effort due to which we need not to write them ourselves.
provides high-performance implementations of useful data structures and
algorithms that increases the performance.
in establishing a common language to pass collections back and forth that
provides interoperability between unrelated APIs.
is resizable and can grow.
of collections framework:
must cast to correct type.
can't be done compile-time type checking.