Many students and Job seekers acknowledge that mastering Java collections is a tough task without proper guidance. As a result, they are often left behind in the competition for well-paying… Read More
Spliterator
instance is used to traverse and partition the elements of a source. Array,
Collection, IOChannel etc., come under spliterator source.
Example
1: Traverse the List
eleme… Read More
Fail-safe and fail-fast operations in Java are related to the behavior of iterators when a collection is modified while it is being iterated.A fail-safe iterator creates a copy of the collec… Read More
Java is a powerful programming language that allows developers to create complex applications with ease. One of the most important features of Java is its ability to iterate through collecti… Read More
In many ways Vector class in Java is just like ArrayList apart from some differences and this post is about those differences between the ArrayList and Vector in Java. There are many similar… Read More
Though both Hashtable and HashMap in Java have some similarities like storing elements as a (key, value) pair and using hashing technique to store elements. From Java V1.2, Hashtable class w… Read More
HashMap in Java is Hash table based implementation of the Map interface that is used for storing (key, value) pairs. HashMap class in Java extends AbstractMap class and implements Map, Clon… Read More
Difference between Hash Table vs Hash Map
Hash Table vs Hash Map will give out the differences of Hash Table and Hash Map. Both of these are used to store unique keys using hashing techniqu… Read More
Definition of Hashmap and Hashtable
Hashmap and Hashtable are some of the main data structures of java used according to the requirement. Both the data structure are part of the collection… Read More
ConcurrentModificationException is thrown by a method when it detected a concurrent modification of an object when such modification is not permissible. Let’s see it with an exa… Read More
In this post, I am going to explain how to call a method asynchronously. Approach 1: Using threads Examplenew Thread(() -> {// Method to execute Printer.sayHello(2);}).start… Read More
ArrayDeque in Java is a concrete class that creates a dynamic array (resizable array) to store its elements from both sides of the queue.
It provides a resizable-array implementation of dequ… Read More
The collections framework provides two general-purpose set implementations in Java: HashSet and TreeSet. In this tutorial, we will learn HashSet in Java with example programs in an easy way… Read More
The collection framework provides two general-purpose Set implementations: HashSet and TreeSet. In this tutorial, we will learn HashSet in Java with example and programs in a very simple wa… Read More
In the last article, I have shown how to remove key/value pairs from a map in Java based upon some conditions like remove all entries where values are greater than some values. I have told y… Read More
When you look at the most popular Java interview questions, you might encounter the one about fail-fast and fail-safe iterators: What’s the difference between fail-fast and fail-safe i… Read More
Java Iterator Iterator is an interface which is made for Collection objects like List, Set. It comes inside java.util package and it was introduced in java 1.2 as public interface Itera… Read More