In this example we are checking whether a particular value exists in HashMap or not. We will be using containsValue() method of HashMap class to… [Read More]
Java – Get size of HashMap example
In this example we are gonna see how to get the size of HashMap using size() method of HashMap class. Method definition and description are… [Read More]
Java – HashMap Iterator example
Example In the previous tutorial we have seen different-2 ways to iterate a HashMap. In this example we are gonna see how to iterate a… [Read More]
Java – Remove all mappings from HashMap example
Example In the last tutorial we shared how to remove a specific mapping from HashMap based on key. In this example we are going to… [Read More]
Java – Remove mapping from HashMap example
Example In this example we are gonna see how to remove a specific mapping from HashMap using the key value of Key-value pair. We will… [Read More]
Java – Get element from specific index of LinkedList example
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]
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]
- « Previous Page
- 1
- …
- 3
- 4
- 5
- 6
- 7
- …
- 11
- Next Page »