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)
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
Billi
9 days agoEugene
10 days agoHerminia
10 days agoShannan
15 days agoTalia
16 days agoCiara
19 days agoEdison
26 days agoAudry
7 days agoBong
15 days agoGladys
27 days agoTalia
8 days agoJose
11 days agoEdmond
14 days ago