Java 8 Collection Framework

Java 8 Collection Framework

Introduction

Collection Framework is used to handle the group of objects of a program. The Collection Framework provides different implementation of interfaces such as LinkedList, HashSet, TreeSet. Also standard Array is also a part of this framework. Collection Framework also has one interface called as Iterator. The iterator is used to enumerate the content of a collection. Following are the List of Collection interface provided by the framework:-

  1. Array
  2. LinkedList
  3. HashSet
  4. TreeSet
  5. Map
  6. Deque
  7. List
  8. NavigableSet
  9. Queue
  10. Set
  11. SortedSet

These collection uses Comparator, RandomAccess, Iterator, ListIterator and Spliterator.

Compartor is used to compare two objects

The Iterators are used to enumerate the object within the collection

In addition to this there are optional methods, Optional methods are used to modify the content of the collection.

Collection is a generic interface

interface Collection

E is the type of object that particular collection can hold.

Methods in Collection interface:-

Collection Methods

In the next post we will see each of the Collection provided in the Framework with their examples.