How-to articles, tricks, and solutions about COLLECTIONS
How to sort an ArrayList in Java
To sort an ArrayList in Java, you can use the Collections.sort method.
Java - How to create new Entry (key, value)
To create a new key-value pair in a Map in Java, you can use the put method.
Ways to iterate over a list in Java
There are several ways to iterate over a List in Java. Here are some of the most common approaches: