Known rule from Effective Java says: Know and use the libraries. Java Collections Tutorial will teach you how to effectively use vast JDK Collections API and become a better software developer!
Java Collections Tutorial
- Java add array to list
Find out how to add a number of items to a list!
- Java Deque Stack Queue
Learn how to use Deque as Stack (LIFO Queue)!
- Java binary search
Find elements using fast binary search!
- Java binary search comparator
Use binary search on your types with own Comparator!
- Java safe List and other Collections
Indispensable way to track ClassCastException in your collections!
- Java List copy
Shows different ways to copy Lists in Java.
- Java contains any
Find out how to check that a collection in Java contains any of elements from some other collection.
- Java find/count occurrences
Shows how to find/count occurrences of objects inside a Collection.
- Java list replace/fill elements
How to replace or fill all/selected elements in a Collection.
- Java empty List/Collection and null check
Shows how to implement Null Object Pattern and make code readable.
- Java Collection to Enumeration
Shows how to turn Collection into Enumeration to work with legacy code.
- Java List sublist
Shows how to find a first/last occurrence of sublist in Java List.
- Java Enumeration to List
Shows how to convert Enumeration into List.
- Java Collection min/max value
In which you learn how to find min/max values in a Collection.
- Java Collections nCopies
Shows how to create a Java List with copies of the same element.
- Java Collections newSetFromMap
Learn how to create a Set with characteristics of Map.
- Java reverse List
Reverse Java List in the simplest way.
- Java reverse Comparator
Example of reversing array/list using Reverse Comparator
- Java rotate List
Rotating List and move element to position example.
- Java randomly shuffle
Shows how to randomly shuffle an array or List.
- Java singleton List
The example shows how to create singleton List.
- Java sort List
The sorting examples – natural ordering and with Comparator.
- Java List swap
Learn to swapping List elements on sorting example.
- Java synchronized List
The simplest way to guarantee thread-safety of List.
- Java immutable List
Preserve your lists from unwanted modifications.
- Java PriorityQueue by example
How to use PriorityQueue to process elements in order of importance.