Class diagrams are used to show the different objects in a system, their attributes, operations, and the relationships among them. They are the main building block in object-oriented modeling and are used to visualize and design the structure and interactions of application objects. Class diagrams help design and develop object-oriented systems by modeling real-world concepts as classes.