What is the difference between HashMap and Hashtable in Java?

In Java, both the Hashtable and HashMap are data structures based on hashing and implementation of the Map interface the primary distinction is that HashMap is not thread-safe, whereas Hashtable is. As a result, HashMap cannot be used in a multi-threaded Java application without external synchronization. Another distinction is that HashMap supports one null key … Read more