In this example we are gonna see how to get an element from specific index of LinkedList using get(int index) method: public E get(int index):… [Read More]
Archives for 2014
Java – Check if a particular element exists in LinkedList example
In this example we are gonna see how to check if a particular element exists in LinkedList using contains() method: public boolean contains(Object o): Returns… [Read More]
Java – Add elements at beginning and end of LinkedList example
Example In this example we will learn how to add elements at the beginning and end of a LinkedList. We will be using addFirst() and… [Read More]
How to convert LinkedList to array using toArray() in Java
Converting LinkedList to array is very easy. You can convert a LinkedList of any type (such as double, String, int etc) to an array of… [Read More]
Java – Convert a LinkedList to ArrayList
Example In this example we are converting a LinkedList to ArrayList. We have a LinkedList of Strings in which we are storing names of 5… [Read More]
Java – Get first and last elements from LinkedList example
In this tutorial we will see an example on how to get first and last element from LinkedList. Example Here we have a LinkedList of… [Read More]
Java – Get sub List from LinkedList example
Example In this example, we are getting a sublist of LinkedList using subList(int startIndex, int endIndex) method of LinkedList class. It returns a List between… [Read More]
Java – Add element at specific index in LinkedList example
In this tutorial we will learn how to add a new element at specific index in LinkedList. We will be using add(int index, Element E)… [Read More]
Java – LinkedList Iterator example
In the last post we learnt how to traverse a LinkedList using ListIterator. Here we will learn how to iterate a LinkedList using Iterator. Example… [Read More]
Java – LinkedList ListIterator example
In this example we will see how to iterate a LinkedList using ListIterator. Using Listterator we can iterate the list in both the directions(forward and… [Read More]
Java – Remove all elements from LinkedList example
In this example we will see how to remove all the elements from LinkedList. We will be using clear() method of LinkedList class to do… [Read More]
Java – Remove first and last element from LinkedList example
In this tutorial we will learn how to remove First and Last elements from LinkedList. In the few last posts we shared following tutorials: 1)… [Read More]
Java – Remove specific elements from LinkedList example
In the last post we shared a tutorial on how to remove a element from specific index in LinkedList. Here we will learn how to… [Read More]
Java – Remove element from a specific index in LinkedList example
In this example, we are gonna see how to remove an element from LinkedList. Example We will be using remove(int index) method of LinkedList class… [Read More]
Java – Replace an element in a LinkedList with example
In this article, we will learn how to replace an element in linked list using set() method. This method is especially useful when we need… [Read More]
- « Previous Page
- 1
- …
- 5
- 6
- 7
- 8
- 9
- …
- 16
- Next Page »