Difficulty: Easy
Correct Answer: It describes 'kind of' relationships.
Explanation:
Introduction / Context:
A class hierarchy is the backbone of inheritance. Understanding what it communicates conceptually is crucial for correct modeling. The question asks which real-world relationship a hierarchy intends to express.
Given Data / Assumptions:
Concept / Approach:
Inheritance models an “is-a” or “kind-of” relationship. A Dog is a kind of Animal; a Square is a kind of Shape. This is distinct from “has-a” (composition/aggregation), where an object contains or owns another object (e.g., Car has an Engine). Thus a class hierarchy primarily expresses “kind of”.
Step-by-Step Solution:
1) Identify inheritance (Base ← Derived) → semantic meaning: Derived is-a Base.2) Map to wording: “kind of” is the best natural-language equivalent of is-a.3) Recognize alternatives: “has-a” corresponds to fields/members (composition), not the hierarchy tree.4) Therefore, choose “It describes 'kind of' relationships.”
Verification / Alternative check:
UML generalization arrows encode is-a; composition/aggregation are separate notations. Documentation consistently defines hierarchies as modeling is-a.
Why Other Options Are Wrong:
Organization chart / family tree: visual analogies but not precise semantics.“Has a”: that is composition/aggregation, not inheritance.“Uses”: denotes dependency, not hierarchical generalization.
Common Pitfalls:
Overusing inheritance to model “has-a”; prefer composition for containment to reduce coupling and improve flexibility.
Final Answer:
It describes 'kind of' relationships.
Discussion & Comments