Add elements in HashTable

We can use put() and putAll() methods of HashTable to add elements to HashTable Object put(Object key, Object value); Associates the specified value with the specified key in this map. This method is used to add single key-value pair to the HashTable Example import java.util.*; public class HashTablePutExample { public static void main(String args[]) { […]

Share this article on

HashTable overview

It’s basically designed to store key value pairs HashTable class implements the Map interface and it inherits Dictionary class Main features of HashTable It stores data in the form of key-value pair HashTable is the Synchronized data structure Keys in the HashTable must be unique It does not allow Null key and Null value It […]

Share this article on
< Previous Next >