A collection is an object that represents a group of objects and it is a unified architecture for representing and manipulating collections
Advantages of having a collections framework
Increases performance by providing high-performance data structures and algorithms
Interoperability between the different collections
Having a common language for manipulating the collections
Collection Classes
This group of classes represent various data structures used to store and manage objects and their underlying implementation is implied in the class names, such as ArrayList and LinkedList .Several interfaces are used to define operations on the collections, such as List, Set, SortedSet, Map, and SortedMap
Components of Java Collections Framework
Collection Interfaces: form the basis of the framework such as sets, lists and maps
Implementations Classes: implementations of the collection interfaces
Utilities: Utility functions for manipulating collections such as sorting, searching…
Collections Interfaces
Interface: Collection
The Collection interface is the root of the collection hierarchy
public interface Collection {// Basic Operationsint size();boolean isEmpty();boolean contains(Object element);boolean add(Object element);boolean remove(Object element);Iterator iterator();// Bulk Operationsboolean containsAll(Collection c);boolean addAll(Collection c);boolean removeAll(Collection c);boolean retainAll(Collection c);void clear();// Array OperationsObject[] toArray();Object[] toArray(Object a[]);}
No comments:
Post a Comment