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:-
- Array
- LinkedList
- HashSet
- TreeSet
- Map
- Deque
- List
- NavigableSet
- Queue
- Set
- 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:-
In the next post we will see each of the Collection provided in the Framework with their examples.
Top comments (0)