Retrieve Hashtable elements

We know that HashTable is a key-value pair based data structure. Sometimes, we need to retrieve all the keys of HashTable Sometimes we need to retrieve value for the specified key from the HashTable Sometimes we need to retrieve all the values from a HashTable Let’s see how we can achieve all these retrievals Case1: […]

Share this article on

Remove HashTable elements

We can remove elements from HashTable using methods provided in it There are 2 methods listed below which can be used to remove elements from HashTable Object remove(Object key) Removes the mapping for the specified key from this HashTable if present. Void clear() Removes all of the mappings from this HashTable Example import java.util.*; public […]

Share this article on
< Previous Next >