• August 31, 2014
  • Core Java
  • Comments Off on Collection framework in java

Collection framework in java

Collection is a simply an object that represents a group of objects into a single unit.

Collection framework:

Collection framework is a unified architecture or a set classes and interfaces for representing and manipulating collections. i.e. collection framework is used to store, retrieve and manipulate collections.

 Collection framework contains following:

  1. 1. Interfaces: are abstract data types that represent collections and allow collections to be manipulated independently of the details of their representation.
  2. 2. Classes/Implementations: are the concrete implementations of the collection interfaces.
  3. 3. Algorithms: are the methods used for collection computations, like searching and sorting.

Advantages/Benefits of collection framework:

  1. 1. Reduces programming effort: Collection framework provides useful data structure and algorithms for collection manipulation, you not have to write them.
  2. 2. Increases program speed and quality: Collection framework provides high-performance and high-quality implementations of useful data structures and algorithms which increase the speed and quality.
  3. 3. Resizable: Collection is resizable.
  4. 4. Reduces effort to design new APIs: becausecollection framework eliminates the need to produce ad hoc collections APIs.

Disadvantages of collection framework:

  1. 1. It must cast to correct type.
  2. 2. It can’t be done compile-time type checking.
 Note: Above two disadvantages can be removed from collection framework by using generics.

Core Collection Framework interfaces are categories into two sets collections and maps.

Note: Maps are not the integral part of collection framework but are considered as collection because they can store and manipulate group of objects like collections.

 
Next Topic: Collection interfaces in java.
Previous Topic: Transient in java with example.

Related topics:

Collection framework in java.
Collection interfaces in java.
Collection interface in java with example.
Set interface in java with example.
SortedSet interface in java with example.
List interface in java with example.
Map interface in java with example.
Daemon thread in java in java with example.
SortedMap interface in java with example.
Queue interface in java with example.
Deque interface in java with example.
Enumeration interface in java with example.
Collection classes in java with example.
HashSet in java with example.
LinkedHashSet in java with example.
TreeSet in java with example.
ArrayList in java with example.
LinkedList in java with example.
HashMap in java with example.
LinkedHashMap in java with example.
TreeMap in java with example.
PriorityQueue in java with example.
ArrayDeque in java with example.
Abstract classes in collection framework in java with example.
Sorting in java with example.
Comparable interface in java with example.
Comparator interface in java with example.
Properties class in java with example.
Hashtable in java with example.
ListIterator interface in java with example.

 


Comments are closed.