
Java – Different ways to iterate over HashMap of ArrayList
In one of the previous articles, we already discussed different ways to iterate through Map but those are with String object only i.e.; both keys and values are Read More
In one of the previous articles, we already discussed different ways to iterate through Map but those are with String object only i.e.; both keys and values are Read More
In this article, we will discuss how to serialize list of objects and also de-serializing same Already we have seen how to serialize and de-serialize objects Read More
In this article, we will discuss difference between CopyOnWriteArrayList and SynchronizedList classes in detail i.e.; CopyOnWriteArrayList v/s SynchronizedList Lets us move on and discuss key differences Read More
In this article, we will discuss difference between CopyOnWriteArrayList and ArrayList classes in detail i.e.; CopyOnWriteArrayList v/s ArrayList Lets us move on and discuss key differences Read More
In this article, we will discuss what happens when element is removed from CopyOnWriteArrayList and ArrayList while iterating using Iterator i.e.; remove() operation with CopyOnWriteArrayList; Read More
In this article, we will discuss how can we achieve both read (iterate) and modify (remove/add) operations simultaneously by 2 different threads using CopyOnWriteArrayList which Read More
In this article, we will discuss CopyOnWriteArrayList class – the implementation class for List interface in detail This is the thread-safe version of ArrayList, where Read More
In this article, we will discuss how to remove elements from ArrayList while iterating Collections objects using Iterator interface Note: ConcurrentModificationException will be thrown when Read More
In this article, we will discuss how to get minimum element from ArrayList using Collections class’s utility min() method 1. To get minimum element from Read More
In this article, we will discuss how to get maximum element from ArrayList using Collections class’s utility max() method 1. To get maximum element from Read More
In this article, we will discuss how to convert Ordered ArrayList into Sorted TreeSet in Java We can sort ArrayList in both ascending and descending Read More
In this article, we will discuss how to remove duplicate elements from ArrayList Q) How to convert ArrayList to HashSet ? use inter-conversion collection constructor Read More
In this article, we will discuss how to reverse the contents of LinkedHashSet Key points about LinkedList: LinkedHashSet maintains insertion-order It uses doubly-linked list and Read More
In this article, we will discuss how to remove duplicate elements from ArrayList maintaining its insertion-order 1. Solution: simply, convert to LinkedHashSet 2. Remove duplicate Read More
In this article, we will discuss how to replace/update content of ArrayList using set method of List interface This method replaces old value with new Read More
In this article, we will discuss how to sort contents of ArrayList in descending order using Collections class’s utility sort() and reverseOrder() methods sort(); –> to Read More
In this article, we will discuss how to reverse the contents of ArrayList using Collections class’s utility reverse() method 1. To reverse ArrayList contents : Read More
In this article, we will add one ArrayList to another ArrayList contents using addAll() method of Collection interface Adding one ArrayList contents to another ArrayList Read More
In this article, we will compare 2 ArrayList contents using containsAll method of Collection interface This Collection method is used to check whether one list Read More
In this article, we will discuss an example on how to search whether particular element present in ArrayList or NOT 1. Searching element from ArrayList Read More