List List1 New Arraylist 2. List List2 New Linkedlist 3. List List3 New Vector
List List1 New Arraylist 2. List List2 New Linkedlist 3. List List3 New Vector
List(I) Can have ordered collection of objects; can have duplicate values
1. List <data-type> list1= new ArrayList();
ArrayList
LinkedList 2. List <data-type> list2 = new LinkedList();
3. List <data-type> list3 = new Vector();
Vector
4. List <data-type> list4 = new Stack();
Stack
Queue(I)
PriorityQueue
Deque can remove and add the elements from both the side
ArrayDeque implements the Deque interface
Set(I)
HashSet Set<data-type> s1 = new HashSet<data-type>();
LinkedHashSet Set<data-type> s2 = new LinkedHashSet<data-type>();
SortedSet SortedSet<data-type> set = new TreeSet();
TreeSet Set<data-type> s3 = new TreeSet<data-type>();
dynamic array to store the duplicate element of different data types
can store the duplicate elements
Vector uses a dynamic array to store the data elements. It is
similar to ArrayList
an ordered list
a double-ended queue which enables us to perform the operations at both the ends
ArrayDeque is faster than ArrayList and Stack and has no capacity restrictions.
unordered set of elements which doesn't allow us to store the duplicate items
It contains unique items
also contains unique elements and maintains the insertion order
elements of the SortedSet are arranged in the increasing (ascending) order
contains unique elements and elements in TreeSet stored in ascending order
elements stored can be randomly accessed
the manipulation is fast because no shifting is required.
The stack contains all of the methods of Vector class and also
provides its methods like boolean push(), boolean peek(),
boolean push(object o), which defines its properties.