What is the primary difference between `ConcurrentHashMap` and `HashMap` in Java?
`ConcurrentHashMap` is thread-safe and allows concurrent reads and writes without locking the entire map, whereas `HashMap` is not thread-safe.
Exactly! `ConcurrentHashMap` ensures thread-safety by using a finer granularity of locks compared to `HashMap`.
Can you explain how `ConcurrentHashMap` handles concurrent writes to different segments?