HashMap — non-synchronized, permits nulls. HashTable — synchronized, rejects nulls. Legacy class from Java 1.0.Vivid analogy: HashMap is a personal journal — quick to write, but concurrent writes may corrupt entries. HashTable is a locked ledger — safe but slower.Why it matters: Knowing HashMap internals (hash function, collisions, load factor, tree-ification) is crucial for performance-critical code.javaHashMap<String, Integer> hm = new HashMap<>();hm.put("apple", 3);hm.put(null, 0); // null key OKhm.put("banana", null); // null value OKHashtable<String, Integer> ht = new Hashtable<>();ht.put("apple", 3);// ht.put(null, 0); // NullPointerException!// ht.put("k", null); // NullPointerException!- HashMap — single-threaded (default).- HashTable — legacy, avoid.- ConcurrentHashMap — modern thread-safe alternative.