AbstractList in Java with Examples
The AbstractList class in Java is a part of the Java Collection Framework and implements the Collection interface and the AbstractCollection class. It is used… Read More »
The AbstractList class in Java is a part of the Java Collection Framework and implements the Collection interface and the AbstractCollection class. It is used… Read More »
The AbstractQueue class in Java is a part of the Java Collection Framework and implements the Collection interface and the AbstractCollection class. It provides skeletal… Read More »
The ConcurrentSkipListSet class in Java is a part of the Java Collection Framework and implements the Collection interface and the AbstractSet class. It provides a… Read More »
The ConcurrentLinkedQueue class in Java is a part of the Java Collection Framework and implements the Collection interface and the AbstractCollection class. It is used… Read More »
The ConcurrentLinkedDeque class in Java is a part of the Java Collection Framework and implements the Collection interface and the AbstractCollection class. It is used… Read More »
BlockingQueue interface in Java is added in Java 1.5 along with various other concurrent Utility classes like ConcurrentHashMap, Counting Semaphore, CopyOnWriteArrrayList etc. BlockingQueue interface supports… Read More »
Given an array and a key, the task is to remove all occurrences of the specified key from the array in Java. Examples: Input: array… Read More »
Given a Parallel Stream in Java, the task is to reverse its elements. Examples: Input: Parallel Stream = {11, 22, 33, 44} Output: {44, 33,… Read More »
Here are couple of differences between ArrayList and HashSet. Inheritance: Implementation: Implementation : ArrayList implements List interface while HashSet implements Set interface in Java. Internal… Read More »
Given an array list, find the first and last elements of it. Examples: Input : aList = {10, 30, 20, 14, 2} Output : First… Read More »
Given a list, we need to split into two news lists in Java. Input : list = {1, 2, 3, 4, 5, 6} Output :… Read More »
Given an ArrayList with duplicate values, the task is to remove the duplicate values from this ArrayList in Java. Examples: Input: List = [1, 10,… Read More »
Given a TreeSet in Java, task is to sort elements of TreeSet in Descending Order (descreasing order). Examples: Input : Set: [2, 3, 5, 7,… Read More »
Given a Linked List in Java, the task is to insert elements at first and last position in this LinkedList. Examples: Input: LinkedList: [‘e’, ‘e’,… Read More »
Given a HashMap and a key in Java, the task is to check if this key exists in the HashMap or not. Examples: Input: HashMap:… Read More »