If you're looking for a complete guide to learn how to use collections in Java programming language, this page is exactly what you need. Or if you're an experienced Java developer who wants to refresh your knowledge in Java collections and generics, you've also come to the right place.
You know, Java Collections framework provides a set of reusable data structures and algorithms that make programmer's jobs easier. Any Java programmers must learn to use collections fluently, which help creating robust and efficient applications of any kinds because data structures are the heart of any computer programs.
While Java Collections framework provides reusuable data structures (List, Set, Map, Queue, ...), generics offer type safety with regard to using the collections in the right manner. Plus, Java Stream APIs provide convenient and flexible ways to operate on elements in collections. That's why you will learn Java collections and generics together, and use Java Stream APIs for processing data in the collections.
If you're new to Java Collections framework and Generics, check these articles first. You will understand the key concepts and overview of how collections and generics are designed in the Java programming language.
Use Lists to store elements that will be accessed via index, and duplicate elements allowed. Elements are usually stored in the order they added into a List.
Sets are used when the order of elements does not matter and no duplicate elements allowed.
Maps are used when you need a key-value mapping data structure.
You use Queues in producer-consumer processing, i.e. holding elements prior to processing and remove elements afterward.
Check the follow articles to learn more about using arrays in the Java programming language, as well as conversion from arrays to collections.
Learn how to iterate over elements in collections properly
Learn how Java Stream APIs can simplify operations on elements in a collection.
It's recommended to get familiar with advanced concepts like equals, hashCode, object ordering, comparator, etc to use Java collections more efficiently
These articles help you understand advanced concepts in Java Generics:
Learn how to use the utility classes for common operations on collections, so you won't re-invent the wheel.
Following these tutorials is enough to get familiar with Java collections and use the APIs in your daily coding. If you want to learn deeper, I recommend you check the Java Generics and Collections book that covers everything from most basic uses to the strangest corner cases.