What is the difference between HashMap and HashTable in Java?
Hashmap | Hashtable | |
---|---|---|
1. | Nonsynchronized | Synchronized |
2. | Not thread safe | Thread-safe |
3. | Cannot be shared between threads without synchronization code | Can be shared with many threads |
4. | Allows null key and multiple null values | Does not allow null key or value |
BY Best Interview Question ON 13 Jan 2019