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

Java Collections Overview

The document provides an overview of Java Collections, detailing various types such as List, Set, Queue/Deque, and Map. It outlines the characteristics of each type, including whether they are ordered, allow duplicates, and permit null values, along with key operations and methods. Specific classes like ArrayList, HashSet, and HashMap are highlighted with their respective functionalities.
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)
4 views1 page

Java Collections Overview

The document provides an overview of Java Collections, detailing various types such as List, Set, Queue/Deque, and Map. It outlines the characteristics of each type, including whether they are ordered, allow duplicates, and permit null values, along with key operations and methods. Specific classes like ArrayList, HashSet, and HashMap are highlighted with their respective functionalities.
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 Overview

Type Class / Interface Ordered? Allows Duplicates? Null Allowed? Key Operations / Methods

List ArrayList Yes Yes Yes (1 null) add(), get(i), set(i, val), remove(i), contains(), size()

LinkedList Yes Yes Yes All of ArrayList + addFirst(), addLast(), removeFirst()

Set HashSet No No Yes (1 null) add(), remove(), contains(), size()

LinkedHashSet Yes No Yes Same as HashSet

TreeSet Sorted No No add(), first(), last(), ceiling(), floor()

Queue / Deque PriorityQueue No Yes Yes add(), poll(), peek() (min-heap by default)

ArrayDeque Yes (double-ended) Yes No addFirst(), addLast(), pollFirst(), pollLast()

Map HashMap No Keys No, Values Yes 1 null key, many null values put(k,v), get(k), remove(k), containsKey(), keySet()

LinkedHashMap Yes (insertion order) Same Same Same as HashMap

TreeMap Sorted by key Same No null keys firstKey(), lastKey(), put(), get()

You might also like