Home › OCUP 2 Intermediate › Practice questions › Classification
OCUP 2 Intermediate · OMG · Classification · Bank updated 2026-11-03

OCUP 2 Intermediate practice questions: Classification

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

These 5 questions come from the Classification section of our OCUP 2 Intermediate bank (30 questions on this area, which carries 6% of the real exam). Every question is original, with the correct answer explained and linked to the source it is drawn from.

Try 6 free OCUP 2 Intermediate questions → All OCUP 2 Intermediate sample questions

Free: 6 questions in study mode, no card. All 30 Classification questions and the full OCUP 2 Intermediate bank: $15 one-time.

1/5 · Classification · hard
Operation Loan::interest() : Real {query} has the body condition result = principal * rate and the postcondition result >= 0. Subclass MortgageLoan redefines interest(). Which change may MortgageLoan's redefinition make?
AReplace both the body condition and result >= 0
BOverride result >= 0 but keep the body condition
CKeep both; a redefinition may override neither
DOverride the body condition but keep result >= 0
Answer: D. Sub clause 9.6.3.1 (PDF p. 159) states that the bodyCondition differs from postconditions in that it may be overridden when an Operation is redefined, whereas postconditions may only be added during redefinition. MortgageLoan may therefore replace result = principal * rate with its own body condition, but it must keep result >= 0. Source: OMG UML 2.5.1 specification
2/5 · Classification
Class Cart has the derived attribute /total : Money, and a derivation constraint states that total equals the sum of the prices of its lines. The attribute has isReadOnly set to false, its default. A client writes to total a value that differs from the sum of the line prices. Under UML 2.5.1, what follows?
AAccepted, and the implementation must keep the derivation constraint met
BAccepted and stored, and the derivation constraint is reported as violated
CRejected: a derived attribute is always read-only, whatever its isReadOnly
DStored as given, and the derivation constraint no longer applies to total
Answer: A. Clause 9.5.3 says that derived Properties are often specified to be read-only, but where a derived Property is changeable, an implementation is expected to make appropriate changes to the model. It also says an implementation shall ensure that the constraints implied by the derivation are maintained if the Property is updated. Clause 9.4.3.2 says isReadOnly is false by default, so the value may be modified. Source: OMG UML 2.5.1 (formal/17-12-05), clauses 9.4.3.2 and 9.5.3 (PDF p. 150, 154). Source: OMG UML 2.5.1 specification
3/5 · Classification · hard
Operation Archiver::purge needs a Parameter whose value is a Document, which is a Class with identity. The modeler wants the model to declare that the Document passed through this Parameter does not exist after executions of the behavior are finished. Which Parameter declaration can carry that effect?
AAn out Parameter typed by Document, with effect delete
BA return Parameter typed by Document, with effect delete
CAn inout Parameter typed by Document, with effect delete
DAn in Parameter typed by a DataType, with effect delete
Answer: C. The delete effect is restricted to in and inout Parameters, while create is restricted to out, inout and return. The effect property does not apply to Parameters typed by data types, because they have no identity. Hence only the inout Document Parameter is valid here, and in with a Document type would also be, but is not offered. Source: OMG Unified Modeling Language 2.5.1 (formal/17-12-05), 9.4.3.4 Parameters, p. 152 Source: OMG UML 2.5.1 specification
4/5 · Classification · easy
A class diagram shows class Invoice with a name compartment and an attributes compartment that lists two attributes. The tool has suppressed the operations compartment, so no separator line is drawn for it. A reviewer asks what the diagram tells about the operations of Invoice. What can be concluded?
AInvoice declares no operations of its own
BOperations of Invoice cannot be inferred either way
CInvoice declares operations, all with private visibility
DInvoice declares operations, but only inherited ones
Answer: B. A Classifier shape may hide any compartment. According to 9.2.4.1, when a compartment is suppressed, no inference may be drawn about the presence or absence of elements in it. The diagram therefore neither confirms nor excludes operations of Invoice. Source: OMG Unified Modeling Language 2.5.1 (formal/17-12-05), 9.2.4.1 Classifiers, p. 143-144 Source: OMG UML 2.5.1 specification
5/5 · Classification · hard
Template class Container has a RedefinableTemplateSignature with the formal parameter T. Class SortedContainer specializes Container and is a template itself, adding the formal parameter C. Which formal TemplateParameters belong to the signature of SortedContainer?
AC alone, the parameter added by SortedContainer
BT alone, the parameter inherited from Container
CC, plus T when SortedContainer is abstract
DBoth T and C, the inherited one and the added one
Answer: D. 9.3.3.2: RedefinableTemplateSignature redefines the signatures of all parent template Classifiers. All formal TemplateParameters of the extended signatures are included in the extending signature, along with any specified locally. SortedContainer is thus parameterized by T and C. Source: OMG Unified Modeling Language 2.5.1 (formal/17-12-05), 9.3.3.2 Template Classifier specialization, p. 146 Source: OMG UML 2.5.1 specification
Try 6 more free OCUP 2 Intermediate questions → See the whole OCUP 2 Intermediate bank

Other OCUP 2 Intermediate areas

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

Activities & Actions30 qBasic Structure30 qInteractions31 qStateMachines & Use Cases49 qComponents29 qCommon Behavior30 qStructured Classifiers27 q

Practise OCUP 2 Intermediate with instant feedback

6 free questions in study mode · no card · full OCUP 2 Intermediate bank with area filters and the error log: $15 one-time · no dumps, no ads.

Start OCUP 2 Intermediate free →
Read next
OCUP 2 Foundation: Format, Cost and a Study Plan for the OMG UML Exam OCUP 2 Foundation: $350, 90 questions, 120 minutes, 60 correct to pass, Pearson VUE or online. A six-week UML study plan, checked 29 Sep 2026.
ExamDeck is an independent study tool, not affiliated with, endorsed by, or sponsored by OMG. OCUP 2 Intermediate and related marks are trademarks of their respective owners, used for identification only. Exam facts checked against official OMG materials (as of October 2026); always confirm current details with the vendor before booking.