Lists in Java are the core building blocks of the Collections framework. The following tutorials will teach us the basics of working with different Java List classes.
1. Create, Modify and Iterate
- Introduction to ArrayList
- Initialize ArrayList
- Create a List with a Single Element
- Iterate through ArrayList
- Java Iterate List Examples
- Add element at particular index of ArrayList
- Remove element from ArrayList
- Add multiple items to ArrayList
- Arrays.asList() vs new ArrayList()
2. Get Element from List
- Get Sub List of ArrayList
- Find the index of the last index of the element in the ArrayList
- Get the index of the element in the ArrayList
- Get element from ArrayList
- Check if an element exists in ArrayList
3. List Operations
- Compare two ArrayLists
- Synchronize ArrayList
- Swap two elements in ArrayList
- Serialize and Deserialize an ArrayList
- Join two ArrayList
- Make ArrayList Empty
- Check whether ArrayList is empty or not
- Replace the value of an existing element in ArrayList
- Remove duplicate elements in ArrayList
- Remove All Occurrences of Element from a List
4. Sorting
- Guide to Sort an ArrayList
- Sort ArrayList of Objects using Comparable and Comparator
- Sort ArrayList of objects by multiple fields
- Sort ArrayList of objects using Collections.sort() method
5. Conversions
- Convert LinkedList to ArrayList
- Convert Vector to ArrayList
- Convert ArrayList to String Array
- Convert Array to ArrayList
- Convert HashSet to ArrayList
- Convert List to Map
- Flatten a Nested List
6. Difference Between
7. List Methods
- ArrayList add() method example
- ArrayList addAll() method example
- ArrayList clear() method example
- ArrayList clone() – How to clone an ArrayList
- ArrayList contains() method example
- ArrayList ensureCapacity() method example
- ArrayList forEach() method example
- ArrayList get() method example
- ArrayList indexOf() method example
- ArrayList lastIndexOf() method example
- ArrayList listIterator() method example
- ArrayList remove() method example
- ArrayList removeAll() method example
- ArrayList retainAll() method example
- ArrayList replaceAll() method example
- ArrayList removeIf() method example
- ArrayList sort() method example
- ArrayList spliterator() method example
- ArrayList subList() method example
- ArrayList toArray() method example
8. Advance Topics
- Performance Comparison of Looping Through a List
- Merge Two ArrayLists
- Correct Way to Assert Two Equal Lists Ignoring Order
9. List Classes
Happy Learning !!