Description Program to find out the index of last occurrence of an element in LinkedList. Program import java.util.LinkedList; class LinkedListExample { public static void main(String[]… [Read More]
Iterate a LinkedList in reverse sequential order – java
Description Program to iterate a LinkedList in reverse order using descendingIterator() method of LinkedList class. Program import java.util.LinkedList; import java.util.Iterator; class LinkedListDemo { public static… [Read More]
Clone a generic LinkedList in Java
Example import java.util.LinkedList; class LinkedListClone { public static void main(String[] args) { // create a LinkedList LinkedList<String> list = new LinkedList<String>(); // Adding elements to… [Read More]
Adding an element to LinkedList using add(E e) method – Java
Description Program to add a new element to LinkedList using add(E e) method of LinkedList class. Example import java.util.LinkedList; class LinkedListAdd { public static void… [Read More]
Append all the elements of a List to LinkedList – Java
Description Program to add all the elements of a List to the LinkedList using addAll() method of LinkedList class. Example import java.util.ArrayList; import java.util.LinkedList; import… [Read More]
How to get the size of TreeMap example – Java
In this tutorial we willl learn how to get the size of a TreeMap. We are using size() method of TreeMap class to get the… [Read More]
How to get the Sub Map from TreeMap example – Java
In this example we are gonna see how to get a sub map from TreeMap. We are using subMap() method of TreeMap class. Please refer… [Read More]
How to iterate TreeMap in reverse order in Java
By default TreeMap elements are sorted in ascending order of keys. We can iterate the TreeMap in reverse order to display the elements in descending… [Read More]
How to sort a TreeMap by value in java
A TreeMap is always sorted based on its keys, however if you want to sort it based on its values then you can build a… [Read More]
TreeMap Iterator example – Java
In this example we are iterating a TreeMap using Iterator and Map.Entry. import java.util.TreeMap; import java.util.Set; import java.util.Map; import java.util.Iterator; public class TreeMapExample { public… [Read More]
- « Previous Page
- 1
- …
- 3
- 4
- 5
- 6
- 7
- …
- 16
- Next Page »