How to count duplicate elements of ArrayList

In this article, we will count of number of duplicate elements present in List using Collections class’s utility frequency() method   Count duplicate elements from List Method signature: public static … Continue Reading →


How to Reverse order of Comparator

In this article, we will discuss how to reverse order of java.util.Comparator using Collections class’s utility reverseOrder() method This is used to get reverse comparator, which can be used to … Continue Reading →


How to Reverse order of elements in ArrayList

In this article, we will discuss how to reverse order of elements in List using Collections class’s utility reverse() method   Reversing order of elements of Java ArrayList Method signature: … Continue Reading →


Searching element from ArrayList using Binary Search Algorithm

In this article, we will discuss how to search an elements from List using Collections class’s utility binarySearch() method which uses Binary Search algorithm   Cautions: The specified list in … Continue Reading →


Sorting ArrayList using Comparable and Comparator

In this article, we will discuss how to sort elements of List using Collections class’s utility sort() method Default natural sorting order for String, Wrapper types java.lang.Comparable interface –> for … Continue Reading →


Collections – utility class for Collection

In this article, we will discuss Collections class – a utility class for Collection framework which has useful methods for Sorting Searching Reverse the order of elements Shuffling Swapping Checking frequency of … Continue Reading →


PriorityQueue class

In this article, we will discuss PriorityQueue class which orders the elements based on some priority   PriorityQueue: PriorityQueue is a sub-class of AbstractQueue abstract class (i.e.; PriorityQueue extends AbstractQueue) To … Continue Reading →


Queue interface

In this article, we will discuss Queue interface with all its important methods in detail Queue interface follows First-In First-Out (i.e.; FIFO), to order the elements   Queue interface: Queue … Continue Reading →


Properties class

In this article, we will discuss Properties class – one of the Map implemented classes through Java Hashtable class in detail Properties class is a legacy class to store key-value … Continue Reading →


HashMap v/s Hashtable

In this article, we will discuss difference between HashMap and Hashtable classes in detail i.e.; HashMap v/s Hashtable Hashtable is legacy class and based on hashcode of keys where keys are … Continue Reading →


Hashtable class

In this article, we will discuss Hashtable class – one of the Map implemented classes in detail Hashtable is legacy class and based on hashcode of keys where keys are unique … Continue Reading →


HashMap v/s HashSet

In this article, we will discuss difference between HashMap and HashSet classes in detail i.e.; HashMap v/s HashSet   HashMap v/s HashSet HashMap  HashSet HashMap implements Map interface HashSet implements Set … Continue Reading →


Page 1 of 2612345...1020...Last »