0% found this document useful (0 votes)
2 views20 pages

Java Collections Cheat Sheet Guide

This document provides a flow diagram and table to help choose the appropriate Java collection class based on needs and compares common features of collection classes like ArrayList, LinkedList, Vector, Stack, Queue, HashSet and TreeSet.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views20 pages

Java Collections Cheat Sheet Guide

This document provides a flow diagram and table to help choose the appropriate Java collection class based on needs and compares common features of collection classes like ArrayList, LinkedList, Vector, Stack, Queue, HashSet and TreeSet.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

[Link]

html
This Flow diagram will help you choose your Collection Class effectively based on your needs :-
Tabular Representation of some common features of Java Collection Class :-
Constructing various collections
ArrayList<Integer> al = new ArrayList<Integer>();
Stack<String> sk = new Stack<String>();
PriorityQueue<Integer> pq = new PriorityQueue<Integer>();
HashSet<String> hs = new HashSet<String>();
TreeSet<String> ts = new TreeSet<String>();
HashMap<Integer,String> hm = new HashMap<Integer,String>();
ArrayList:
LinkedList
Vector:

Queue:
PriorityQueue<Integer> pq = new PriorityQueue<Integer>();
Hash set:
Tree Set:

You might also like