0% found this document useful (0 votes)
10 views1 page

Java Collections Framework

Uploaded by

sou.dutta.14
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)
10 views1 page

Java Collections Framework

Uploaded by

sou.dutta.14
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
You are on page 1/ 1

Java Collections Framework - List with Syntax

Collection Interface
Collection collection = new ArrayList<>();

List Interface
List list = new ArrayList<>(); List list = new LinkedList<>(); List list = new
Vector<>(); List list = new Stack<>();

Set Interface
Set set = new HashSet<>(); Set set = new LinkedHashSet<>(); Set set = new
TreeSet<>();

Queue Interface
Queue queue = new LinkedList<>(); Queue queue = new PriorityQueue<>(); Deque deque =
new ArrayDeque<>();

Map Interface
Map map = new HashMap<>(); Map map = new LinkedHashMap<>(); Map map = new
TreeMap<>(); Map map = new Hashtable<>();

Concurrent Collections
ConcurrentMap cmap = new ConcurrentHashMap<>(); CopyOnWriteArrayList cowList = new
CopyOnWriteArrayList<>(); CopyOnWriteArraySet cowSet = new CopyOnWriteArraySet<>();

Utility Classes
Collections utility class: Collections.sort(list); Collections.reverse(list);
Collections.shuffle(list);

You might also like