HomeOCUP 2 Found.Practice questionsUML Structure: Class & Object Diagrams
OCUP 2 Found. · OMG · UML Structure: Class & Object Diagrams · Bank updated 2026-07-02

OCUP 2 Found. practice questions: UML Structure: Class & Object Diagrams

5 free questions from 115 on this area · answer and explanation for each · no sign-up

These 5 questions come from the UML Structure: Class & Object Diagrams section of our OCUP 2 Found. bank (115 questions on this area). Every question is original, with the correct answer explained and linked to the source it is drawn from.

Start 6 free in study mode → All OCUP 2 Found. sample questions
1/5 · UML Structure: Class & Object Diagrams · easy
An attribute in a class's attribute compartment is written as '/ age : Integer'. What does the leading forward slash indicate according to UML 2.5 notation?
AThe attribute is static and its single value is shared by every instance of the owning class.
BThe attribute is derived: its value can be computed from other attributes or relationships rather than being independently stored.
CThe attribute is optional and may be omitted from an object without violating the class definition.
DThe attribute is read-only and its value cannot change once the object is created.
Show answer & explanation
B is correct. UML 2.5 uses a leading '/' before the name of an attribute (or association end) to mark it as derived: a feature whose value is calculated from other model elements rather than stored as independent state. This is distinct from visibility, static scope, or read-only markings, which use different notation.
↗ UML 2.5 specification — UML Structure: Class & Object Diagrams
2/5 · UML Structure: Class & Object Diagrams · hard
A modeler must capture a many-to-many relationship between Student and Course, and must also record, for each specific enrollment pairing, a numeric grade attribute that can differ across different Student-Course combinations (the same Student may have a different grade for each different Course). Which UML 2.5 structural modeling approach correctly satisfies this requirement?
AAdd a grade attribute directly to the Course class.
BModel Student and Course with a many-to-many association and attach an association class (e.g., Enrollment) that owns the grade attribute, since grade is a property of a specific Student-Course link rather than of either classifier alone.
CChange the multiplicities to 1..1 at both ends so each Student links to exactly one Course and vice versa, then place grade on either classifier.
DAdd a grade attribute directly to the Student class.
Show answer & explanation
B is correct. When an attribute logically depends on a specific pairing of two linked objects rather than on either object individually, UML 2.5 provides the association class construct: it attaches to the many-to-many association and holds attributes (such as grade) that are properties of that particular link, one association class instance per link.
↗ UML 2.5 specification — UML Structure: Class & Object Diagrams
3/5 · UML Structure: Class & Object Diagrams
Two instance specifications, 'e1 : Employee' and 'd1 : Department', are connected in an object diagram by a plain solid line with no arrowheads, diamonds, or other decorations. In the corresponding class diagram, Employee and Department are connected by an association named 'worksIn'. What does this solid line most likely represent?
AA package import relationship between e1 and d1
BA generalization relationship between e1 and d1
CA composition relationship indicating e1 is part of d1
DA link, i.e. an instance of the worksIn association, showing that e1 is connected to d1 at the instance level
Show answer & explanation
D is correct. Links are drawn simply as solid lines connecting instance specifications, corresponding to the association they instantiate; unlike class diagrams, instance-level links typically omit diamonds, generalization triangles, or navigability arrows unless deliberately shown.
↗ UML 2.5 specification — UML Structure: Class & Object Diagrams
4/5 · UML Structure: Class & Object Diagrams · hard
An association end named waypoints has multiplicity 2..* and the property string {ordered, nonunique}. A route may legitimately revisit the same waypoint object twice, such as a round trip that returns to its starting point. Which collection semantics correctly reflect this property string combination?
AAn OrderedSet-like collection: positions are meaningful, but a given waypoint object may only be linked once, which would contradict the round-trip scenario.
BA Bag-like collection: duplicate links are allowed, but no position or sequence information about the linked objects is retained.
CA Sequence-like collection: the linked waypoint objects occupy meaningful positions, and the same object may legitimately appear at more than one position.
DA Set-like collection: there is no positional meaning among the linked objects, and duplicate links are forbidden.
Show answer & explanation
C is correct. Combining isOrdered = true with isUnique = false produces Sequence semantics: the collection preserves a meaningful order of elements while still permitting the same element to appear more than once. This correctly models a route where waypoints have a defined visiting order yet may be revisited, unlike OrderedSet, Set, or Bag, which each fix different combinations of ordering and uniqueness.
↗ UML 2.5 specification — UML Structure: Class & Object Diagrams
5/5 · UML Structure: Class & Object Diagrams
Both a generic Dependency and an Interface Realization can be drawn as dashed lines between classifiers. What distinguishes Interface Realization from a plain Dependency at the notation level?
AInterface Realization is drawn as a solid line while plain Dependency is dashed.
BInterface Realization uses a hollow (unfilled) triangular arrowhead, the same shape used for Generalization, whereas a plain Dependency uses a simple open stick arrowhead.
CInterface Realization must always be labeled with the keyword «realize», while plain Dependency is never labeled.
DInterface Realization always requires a multiplicity label on the dashed line, while plain Dependency never does.
Show answer & explanation
B is correct. Both relationships share the dashed line, but the arrowhead shape differs: Interface Realization borrows the hollow triangular arrowhead from Generalization to signal contract conformance, while a plain Dependency uses a simple open arrowhead. This lets a reader distinguish the two at a glance even without keywords.
↗ UML 2.5 specification — UML Structure: Class & Object Diagrams
Practise all 115 UML Structure: Class & Object Diagrams questions - start free → See the whole OCUP 2 Found. bank

Other OCUP 2 Found. areas

The same kind of free sample for every other section of the OCUP 2 Found. bank:

UML Behavior: Use Case, Activity, Sequence & State119 qUML Foundations & Common Notation58 q

Study UML Structure: Class & Object Diagrams with instant feedback

6 free questions · filter study mode by area and difficulty · error log with spaced repetition · no card, no dumps, no ads.

Create your free account →
ExamDeck is an independent study tool, not affiliated with, endorsed by, or sponsored by OMG. OCUP 2 Found. and related marks are trademarks of their respective owners, used for identification only. Exam facts checked against official OMG materials (as of August 2026); always confirm current details with the vendor before booking.