Collection Framework Advantages


Prev Tutorial Next Tutorial

Difference Between Array and Collection

The main advantage of Collection Framework are Collections are grow-able in nature, hence based on our requirement we can increase or decrease the size. Some others advantage are given below;

  • Collection is re-sizable or dynamically draw-able memory.
  • Provides useful data structures in the form of predefined classes that reduces programming affords.
  • It support to store heterogeneous elements or object.
  • It provides higher performance.
  • It provides Extendability (depends on incoming flow of data,if the size of collection framework variable is increasing than the collection framework variable is containing Extendability feature).
  • It provides adaptability facility( The process of adding the content of one collection framework variable to another collection framework either in the beginning or in the ending or in the middle in known as adaptability).
  • It is one of the algorithmic oriented.
  • It provides in-built sorting technique.
  • It provides in-built searching technique.
  • It provides higher preliminary concepts of Data Structure such as:- Stack,Queue,LinkedList,Trees ..etc.

Difference between Array and Collection

ArrayCollection
1Arrays are fixed in size and hence once we created an array we are not allowed to increase or decrease the size based on our requirement.Collections are grow-able in nature and hence based on our requirement we can increase or decrease the size.
2Arrays can hold both primitives as well as objects.Collections can hold only objects but not primitive.
3Performance point of view arrays faster than collectionPerformance point of view collections are slower than array
4Arrays can hold only homogeneous elements.Collections can hold both homogeneous and heterogeneous elements.
5Memory point of view arrays are not recommended to use.Memory point of view collections are recommended to use.
6For any requirement, there is no ready method available.For every requirement ready made method support is available.

Note: Above difference is same for difference between Array and any Collection object (like Vector, ArrayList, LinkedList).


Prev Tutorial Next Tutorial

Advertisements




Facebook Likes

Advertisements