9 Key Interfaces of collection Framework


  1. Collection
  2. List
  3. Set
  4. SortedSet
  5. NavigableSet
  6. Queue
  7. Map
  8. SortedMap
  9. NavigableMap
Collection(I): If we want to represent a group of individual objects as a single entity then we should go for collection.
  • Collection interface define the most common methods which are applicable for any collection object.
  • In general collection interface is consider as root interface of collection framework.
  • There is no concrete class which implements collection interface directly
Difference between collection and collections
  • Collection is an interface. If we want to represent a group of individual object as a single entity then we should go for collection
  • Collections is an utility class present in java.util package to define several utility method for collection object(like sorting, searching etc)
List(I): It is the child interface of collection. If we want to represent a group of individual objects as a single entity where duplicates are allowed and insertion order must be preserved then we should go for List.

You can learn this in detail in our institute which provides advance Java training in Delhi and Core java training in Delhi.
Note:- in 1.2version vector and stack classes are reengineered to implement List Interface.
  • Set(I): It is the child interface of collection. If we want to represent a group of individual objects as a single entity where duplicates are not allowed and insertion order not required then we should go for set Interface

  • SortedSet(I): It is the child interface of set. If we want to represent a group of individual objects as a single entity where duplicates are not allowed and all objects should be inserted according to some sorting order, then we should go for sorted set.
  • NavigableSet(I): It is the child interface of sorted set. It contains several methods for navigation purposes.

Queue(Interface): it is the child interface of collection. If we want to represent a group of individual object prior to processing then we should go for queue. Usually queue follows first in first out order but based on our requirement we can implement our own priority order also.

Map(Interface): Map is not child interface of Collection.
  • If we want to represent a group of objects as key value pairs then we should go for map.
  • Both key and values are object only duplicate keys are not allowed but values can be duplicated.

SortedMap(Interface): It is a child interface of map.
  • If we want to represent a group of key value pairs according to some sorting order of keys Then we should go for sortedMap.
  • In sortedMap the sorting should be based on key but not based on value.

NavigableMap(Interface): It is the child Interface of sortedMap it define several methods for navigation purposes.

Small Notes About java:-
Java is a general purpose, object-oriented programming language. Latest version is Java 9, released on September 21,2017 has various functionalities. We are just discuss var-arg parameter today, Codec Networks provides best Java Training & Certification in Delhi.

Comments