ssd3 Multiple-Choice Quiz 2

这篇博客主要讨论了UML类图的用途,它能够展示类的内部结构如属性和方法,以及类与类之间的关系。文章通过一系列选择题的形式,详细解释了类的组成部分、类之间的聚合、关联等不同关系,并区分了聚合与关联的特殊形式。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 1.

UML class diagrams can describe which of the following?

  1. The internal structure of classes
  2. Relationships between classes


(a) I and II
(b) None
(c) II only
(d) I only

Answer: a

I.  UML类图能表达出类的内部结构,如:类名,属性,方法。

II. UML类图能表达类与类之间的关系。

 



2.

In a UML class diagram's representation of a class, the top, middle, and lower rectangular compartments respectively describe the _____ of the class.



(a) attributes, methods, and name
(b) attributes, methods, and constants
(c) name, attributes, and methods
(d) name, methods, and constants

Answer:c

top:类名

middle:属性

lower:方法

 



3.

A collection typically models a _____ relationship.



(a) one-to-one
(b) zero-to-one
(c) many-to-many
(d) one-to-many

Answer:d

集合是一对多的关系。

 



4.

A relationship that exists between two specific instances of an object is known as a(n)



(a) aggregation
(b) specialization
(c) association
(d) link

Answer:d

排除法。一个对象的两个特例之间不可能是aggregation,specialization,association三种关系中的任何一种。

 



5.

Consider the following UML class diagram.

According to the diagram, which of the following statements is true?



(a) ClassA and ClassB each contain at least one reference to an instance of ClassC.
(b) ClassB and ClassC are both subclasses of ClassA.
(c) ClassA is composed of one instance of ClassB and one or more instances of ClassC.
(d) ClassB has a one-to-one association with ClassA and a one-to-many association with ClassC.

Answer:c

classA由一个类B的实例和一到多个类C的实例组成。

 



6.

Consider the following UML class diagram.

 The diagram describes a



(a) class without methods
(b) relationship between a subclass and a superclass
(c) one-to-one relationship
(d) self-containing class

Answer:d

classA被自我所包含。



7.

Which of the following is true about association and aggregation in UML class diagrams?



(a) Association and aggregation have no meaningful relationship.
(b) Association is a special form of aggregation.
(c) Association is the opposite of aggregation.
(d) Aggregation is a special form of association.

Answer:d

聚合(Aggregation)是联合(association)的一种特殊形式。

 



8.

Consider the following UML class diagram.

Which of the following is (are) true about the system described by the diagram?

  1. An instance of Picture can contain a collection of instances of the class Shape.
  2. An instance of Shape can contain a collection of instances of the class Picture.


(a) None
(b) I only
(c) II only
(d) I and II

Answer:b

I.  An instance of Picture can contain a collection of instances of the class Shape.

II. An instance of Shape can contain no more than one instance of the class Picture.



9.

The static model of a software system typically includes which of the following?

  1. Attributes of classes
  2. Actions that occur between classes
  3. Structural relationships between classes


(a) II and III only
(b) I and III only
(c) I, II, and III
(d) I and II only

Answer:b

静态模型没有包括类之间发生的行为。



10.

An object model describes which of the following?

  1. Attributes of classes
  2. Methods of classes
  3. Relationships between classes


(a) I, II, and III
(b) I and II only
(c) II and III only
(d) I and III only

Answer:a

对象模型描述的既有类属性,又有类方法,还有类与类之间的关系。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值