Java
Sort ArrayList Elements in Descending Order Java
In this article, we will see how to sort ArrayList elements in descending order using sort(List list, Collections.reverseOrder()) method. Examples: Read more…
In this article, we will see how to sort ArrayList elements in descending order using sort(List list, Collections.reverseOrder()) method. Examples: Read more…
In this article, we will see how to sort ArrayList elements in ascending order using a Collections.sort(List list) method. Examples Read more…
The user creates the ArrayList and does all sort of operations on the list. In most of the cases, it Read more…
ArrayList isEmpty() checks if the list is empty or not. If returns true if the list is empty else false Read more…
ArrayList removeAll() is used to remove all the elements contained in the specified collection from the list. It throws NullPointerException Read more…
The remove() method of ArrayList removes the specified element from the list. We can also remove an element at a Read more…
ArrayList ensureCapacity() is used to increase the capacity of the list. A call to this method makes sure that ArrayList Read more…
ArrayList lastIndexOf() is used when there are multiple elements in list with the same value and you want to find Read more…
ArrayList indexOf() method returns the index of the first occurrence of the specified element from the list or -1 if Read more…
ArrayList contains() method checks if the list has the specified element or not. Technically, it returns true only when the Read more…