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]
Remove all mappings from TreeMap example – Java
This is how to remove all the key-value mappings from TreeMap and make it empty. We are using clear() method of TreeMap class to perform… [Read More]
Remove Key-value mapping from TreeMap example
In this tutorial we are gonna see how to remove a Key-value mapping from TreeMap. We are using remove(Object key) method of TreeMap class to… [Read More]
Difference between List and Set in Java
List and Set both are interfaces. They both extends Collection interface. In this post we are discussing the differences between List and Set interfaces in… [Read More]
Check key & Value existence in Hashtable example – Java
Example In this example we are gonna see how to check Key and value existence in Hashtable. We will be using following two methods to… [Read More]
Get size of Hashtable example in Java
Example In this example we are gonna see how to get the size of Hashtable. We will be using size() method of Hashtable class to… [Read More]
Hashtable Iterator example – Java
In this example we will see how to iterate a Hashtable using Iterator. Using Iterator we can display Hashtable key and value separately for each… [Read More]
Hashtable in java with example
This class implements a hash table, which maps keys to values. Any non-null object can be used as a key or as a value. Hashtable… [Read More]
Remove all mappings from Hashtable example – Java
In the last tutorial we have seen how to remove a mapping from Hashtable based on key. In this tutorial we will learn how to… [Read More]
Remove mapping from Hashtable example – Java
In this tutorial we are gonna see how to remove a key-value mapping from Hashtable. We will be using remove(Object key) method of Hashtable class…. [Read More]
Java – Check if a particular key exists in HashMap example
In the last tutorial we learnt how to check whether a particular value exists in HashMap. In this example we are gonna see how to… [Read More]
- « Previous Page
- 1
- 2
- 3
- 4
- 5
- 6
- …
- 11
- Next Page »