Final answer:
The purpose of a class diagram is to document the hierarchy of class relationships.
Step-by-step explanation:
The purpose of a class diagram is to document the hierarchy of class relationships. It helps visualize the structure of a system by showing how classes are related to each other through inheritance, associations, and dependencies. Class diagrams provide a blueprint for designing and understanding object-oriented systems.