Exam4Training

Suppose you are using a programming language that knows the following basic types: byte, short, and long.

Suppose you are using a programming language that knows the following basic types: byte, short, and long.

Which diagram defines them:

A)

B)

C)

D)

A . Option A
B . Option B
C . Option C
D . Option D

Answer: A

Explanation:

In UML, basic types like byte, short, and long are represented as DataType elements. These are typically used to specify the types of attributes, parameters, or return values of operations in a model. Option A shows three separate classes named Byte, Short, and Long, which would represent these as distinct data types within the UML model.

Option B incorrectly uses stereotypes on objects, which is not the correct UML representation for data types.

Option C shows a class with attributes of different types, but it does not define these types as basic types.

Option D is incorrect because it uses stereotypes on DataType elements, which is not the standard way to represent basic types in UML.

According to the UML 2.5 specification, DataTypes are a kind of classifier that specifies a domain of values without identity (section 10.5.8). DataTypes are not classes; they do not have operations and cannot have instances that maintain an identity.

Exit mobile version