Multiple choice technology web technology

Inheritance relationships are represented in the UML notation by:

  1. nesting of classes

  2. lines with a solid diamond at one end

  3. lines with a hollow diamond at one end

  4. lines with a triangular arrow at one end

  5. lines with a triangular arrow at both ends

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Inheritance (generalization) in UML is represented by a solid line with a hollow triangular arrowhead pointing to the parent class. This arrow indicates the 'is-a' relationship where a child inherits from a parent. Solid diamonds represent composition, hollow diamonds represent aggregation, and nesting is not a UML relationship notation.

AI explanation

To answer this question, you need to understand how inheritance relationships are represented in UML (Unified Modeling Language) notation.

Option A) Nesting of classes - This option is incorrect because nesting of classes represents a composition relationship, not an inheritance relationship.

Option B) Lines with a solid diamond at one end - This option is incorrect because lines with a solid diamond at one end represent an aggregation relationship, not an inheritance relationship.

Option C) Lines with a hollow diamond at one end - This option is incorrect because lines with a hollow diamond at one end represent a composition relationship, not an inheritance relationship.

Option D) Lines with a triangular arrow at one end - This option is correct. Lines with a triangular arrow at one end represent an inheritance relationship in UML notation. The arrow points from the subclass (the class that inherits) to the superclass (the class being inherited from).

Option E) Lines with a triangular arrow at both ends - This option is incorrect. Lines with a triangular arrow at both ends represent an association relationship, not an inheritance relationship.

The correct answer is Option D. This option is correct because lines with a triangular arrow at one end represent an inheritance relationship in UML notation.