How to do LinkedList insertion?

We have seen how to create the Java LinkedList. In this post we will learn how does LinkedList insertion work? In Java LinkedList, each element is a node that linked with other nodes.  Let’s see how to insert a node in linked list. Java LinkedList provides some methods that can insert element in linked list. … Read more

Difference between ArrayList and array

In java ArrayList and array, both are famous data structure. In this post, we will discuss the difference between ArrayList and array.  Before moving further, you should read the Array in java and ArrayList in java. 1. Size The most popular difference between ArrayList and Array is size.An Array has fixed length and we can’t … Read more

How to convert array to list java

In recent posts, we have seen how we can convert ArrayList to Array.  In this post, we will see how we can convert array to list java or array to ArrayList.There are a number of ways to convert array to list, we will discuss them. Here is the table content of the article will we … Read more

How to replace element in an ArrayList?

We have seen how to add and remove elements from ArrayList in java. But sometimes, there may be a situation when we want to replace the element in ArrayList. We can use set(int index, E element) to replace the element. set(int index, E element) The set(index, E element) method is used to set the specified … Read more

Java ArrayList methods

We have read how to create and initialize the ArrayList in java. The ArrayList class provides a lot of Java ArrayList methods to operate the data of ArrayList. In this post, we will cover all the methods of ArrayList in java, and let’s see the java ArrayList methods with example. How to add elements to … Read more

How to Convert list to array in java

Before move further we should read what is Array and What is ArrayList in Java?There may be many situations when we need to Convert list to array in java. There are many methods that allow us to convert ArrayList to array. In this post we will discuss how we convert ArrayList to array by use … Read more

How to get java sublist from ArrayList

An ArrayList is a growable array and each element stored in a particular index. We can get the subList from an ArrayList. In this post, we will see java list sublist. The subList() method is used to get a sublist from ArrayList. It returns a portion of ArrayList between the specified fromIndex and toIndex (If … Read more

How to achieve Java sort ArrayList

The most popular questions in java how to sort an ArrayList in java. The sorting of ArrayList objects totally depends on Comparable or Comparator. In this post, we will see the sorting an ArrayList. To sort an ArrayList we have two ways: Here is the table content of the article will we will cover this … Read more

How to Iterate list in java

In this post, we will how to iterate list in java. There are some ways in like Java ArrayList iterator() method, splititerator() method , java arraylist foreach() method. Lets see different ways in java iterate ArrayList. Here is the table content of the article will we will cover this topic.1. Java ArrayList iterator() method2. spliterator() … Read more

How to access ArrayList in java

In recent posts, we have seen how we can add and remove the element from the ArrayList in java.In this post, we will see how to access ArrayList in java. There are two ways to access ArrayList in java, we can access the elements randomly and sequentially. As we know ArrayList maintains the insertion order … Read more