Below is an instruction that describes a task. Write a response that appropriately completes the request.

### Instruction:
Explain the difference between HashMap and TreeMap in Java

### Response:
HashMap is a Map implementation that stores objects in a hash table based on a key. It allows null values. TreeMap is a Map implementation that stores objects in a tree structure based on their keys. It does not allow null values.