LinkedList with Looping

In this article, we will see how to loop LinkedList in java It’s very much common requirement to iterate or loop through LinkedList in java applications There are mainly 4 ways to loop through LinkedList in java 1) Traditional For loop 2) Enhanced For loop 3) While loop 4) Iterator Let’s see each of these […]

Share this article on

Get LinkedList elements

We can use get() method for retrieving the element from LinkedList There are 3 different get() methods in LinkedList 1) Object get(int index); 2) Object getFirst(); 3) Object getLast(); Let’s discuss these methods with example Object get(int index) It returns the value present at the specified index This method throws IndexOutOfBoundsException if the index is […]

Share this article on
< Previous Next >