-> Collection:
. Collection is an unified architecture which consists of classes and interfaces.
. All the Collection classes and interfaces belong to java.util package.
. In order to overcome the drawback of an array we go for Collection classes.
. In collection we can store heterogenous types of data and size is dynamic.
. In collection we jave three sub interfaces...
-> List
-> Queue
-> Set
***********************************************************************************
***********************************************************************************
*****
-> ArrayList:
. ArrayList is the child implementation class of List interface.
-> Features of ArrayList:
. Size is dynamic.
. We can store heterogenouos types of data.
. It is index based collection.
. It allows duplicates.
. It follows order of insertion.
. It allows null.
. Since it is index based collection, we can fetch the elements based upon index
randomly.
. It is not auto sorted.
. Initial capacity is 10;
. It increases its size by 50%.
. It is not synchronized.
. Since it is not synchronized, performance is faster.
***********************************************************************************
***********************************************************************************
*****
-> Vector:
. Vector is the child implementation class of List interface.
-> Features of Vector:
. Size is dynamic.
. We can store heterogenouos types of data.
. It is index based collection.
. It allows duplicates.
. It follows order of insertion.
. It allows null.
. Since it is index based collection, we can fetch the elements based upon index
randomly.
. It is not auto sorted.
. Initial capacity is 10;
. It increases its size by 100%.
. It is synchronized.
. Since it is synchronized, performance is slower.
***********************************************************************************
***********************************************************************************
*****
-> LinkedList:
. LinkedList is the child implementation class of List interface and Deque
interface.
-> Features of LinkedList:
. Size is dynamic.
. We can store heterogenouos types of data.
. It is index based collection.
. It allows duplicates.
. It follows order of insertion.
. It allows null.
. Since it is index based collection, we can fetch the elements based upon index
randomly.
. It is not auto sorted.
. It creates an empty list without any initial capacity.
. Initial capacity is 0.
. It increases its size by 50%.
. It is not synchronized.
. Since it is not synchronized, performance is faster.
***********************************************************************************
***********************************************************************************
*****
-> PriorityQueue:
. PriorityQueue is the child implementation class of Queue interface.
-> Features of PriorityQueue:
. Size is dynamic.
. We can store homogenous types of data.
. It is not index based collection.
. It allows duplicates.
. It is partially auto sorted.
. It doesn't allow null.
. Initial capacity is 1.
. It increases its size by 110%.
. Since it is not index based collection, we can't fetch the elements based upon
index randomly.
. It is not synchronized.
. Since it is not synchronized, performance is faster.
***********************************************************************************
***********************************************************************************
*****
-> HashSet:
. HashSet is the child implementation class of Set interface.
-> Features of HashSet:
. Size is dynamic.
. We can store heterogenous types of data.
. It is not index based collection.
. It doesn't allow duplicates.
. It allows null.
. Since it is not index based collection, we can't fetch the elements based upon
index randomly.
. Initial capacity is 16.
. It increases its size by 50%.
. It doesn't follow order of insertion.
. It is not synchronized.
. Since it is not synchronized, performance is faster.
***********************************************************************************
***********************************************************************************
*****
-> LinkedHashSet:
. LinkedHashSet is the child implementation class of Set interface.
-> Features of LinkedHashSet:
. Size is dynamic.
. We can store heterogenous types of data.
. It is not index based collection.
. It doesn't allow duplicates.
. It allows null.
. Since it is not index based collection, we can't fetch the elements based upon
index randomly.
. Initial capacity is 16.
. It increases its size by 50%.
. It follows order of insertion.
. It is not synchronized.
. Since it is not synchronized, performance is faster.
***********************************************************************************
***********************************************************************************
*****
-> TreeSet:
. TreeSet is the child implementation class of SortedSet interface.
-> Features of TreeSet:
. Size is dynamic.
. We can store homogenous types of data.
. It is not index based collection.
. It doesn't allow duplicates.
. It doesn't allow null.
. Since it is not index based collection, we can't fetch the elements based upon
index randomly.
. Initial capacity is 16.
. It increases its size by 50%.
. It is completely auto sorted.
. It is not synchronized.
. Since it is not synchronized, performance is faster.
***********************************************************************************
***********************************************************************************
*****
-> Map:
. Map is an interface which belongs to java.util package.
. Map has a child interface called SortedMap and a child implementation class
called HashMap.
. SortedMap has a child implementation class called TreeMap.
. HashMap has a child class called LinkedHashMap.
***********************************************************************************
***********************************************************************************
*****
-> HashMap:
. HashMap is the child implementation class of Map interface.
-> Features of HashMap:
. Size is dynamic.
. It is homogenous for one object.
. It is by default generic.
. It stores the data upon key and value.
. It doesn't allow duplicate keys.
. It allows duplicate values.
. It doesn't follow order of insertion.
***********************************************************************************
***********************************************************************************
*****
-> LinkedHashMap:
. LinkedHashMap is the child class of HashMap class.
-> Features of LinkedHashMap:
. Size is dynamic.
. It is homogenous for one object.
. It is by default generic.
. It stores the data upon key and value.
. It doesn't allow duplicate keys.
. It allows duplicate values.
. It follows order of insertion.
***********************************************************************************
***********************************************************************************
*****
-> TreeMap:
. TreeMap is the child implementation class of SortedMap interface.
-> Features of TreeMap:
. Size is dynamic.
. It is homogenous for one object.
. It is by default generic.
. It stores the data upon key and value.
. It doesn't allow duplicate keys.
. It allows duplicate values.
. It is auto sorted upon keys.