Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

OMG Exam OMG-OCUP2-FOUND100 Topic 1 Question 30 Discussion

Actual exam question for OMG's OMG-OCUP2-FOUND100 exam
Question #: 30
Topic #: 1
[All OMG-OCUP2-FOUND100 Questions]

Choose the correct answer:

Consider the following class definition:

Which diagram fragment shows an instance of the Company class in which name has the value OMG?

A)

B)

C)

D)

E)

F)

Show Suggested Answer Hide Answer
Suggested Answer: D

To represent an instance of a class in a UML Object Diagram, the standard notation is to specify the instance name followed by a colon and the class name, and then list the attribute values within the compartment.

The class definition for Company specifies that there is one attribute, name, of type String.

An instance of Company where the name attribute has the value 'OMG' would be shown as follows:

InstanceName : ClassName attributeName = attributeValue

In the provided options, Option D correctly represents an instance of the Company class with the name attribute set to 'OMG'. The name of the instance is not specified, which is allowed in UML when the instance name is not important or is understood from the context.

Thus, the correct answer is:

D . Option D


Contribute your Thoughts:

Currently there are no comments in this discussion, be the first to comment!


Save Cancel