问题 单项选择题

UML中关联的多重度是指()。

A.一个关联类有多少个方法被另一个类调用

B.一个关联类有多少个属性被另一个类调用

C.一个关联类的某个方法被另一个类调用的次数

D.一个关联的实例中有多少个相互连接的对象

答案

参考答案:D

解析:

关联表示了对象间的结构关系。关联的多重度是指一个类的实例能够与另一个类的多少个实例相关联。通常把它写成一个表示取值范围的表达式或写成一个具体值。指定关联一端的多重度,就是说明,在关联另一端类的每个对象要求在本端的类必须有多少个对象。

单项选择题

Lying in the sun on a rock, the cougar(美洲狮) saw Jeb and his son, Tom, before they saw it. Jeb put his bag down quickly and pulled his jacket open with both hands, making himself look big to the cougar. It worked. The cougar hesitated, ready to attack Jeb, but ready to forget the whole thing, too.

Jeb took off his jacket, grasped Tom and held him across his body, making a cross. Now the cougar’ s enemy looked even bigger, and it rose up, ready to move away, but unfortunately Tom got scared and struggled free of Jeb.

"Tom, No !" shouted his father.

But Tom broke and ran and that’ s the last thing you do with a cougar. The second Tom broke free, Jeb threw himself on the cougar, just as it jumped from the rock. They hit each other in mid-air and both fell. The cougar was on Jeb in a flash, forgetting about Tom, which was what Jeb wanted. Cougars are not as big as most people think and a determined man stands a chance, even with just his fists. As the cougar’s claws got into his left shoulder, Jeb swung his fist at its eyes and hit hard. The animal howled(吼叫)and put its head back. Jeb followed up with his other fist. Then out of the comer of his eye, Jeb saw Tom. The boy was running back to help his father.

"Knife, Tom," shouted Jeb.

The boy ran to his father’ s bag, while Jeb started shouting as well as hitting, to keep the cou-gar’s attention away from Tom. Tom got the knife and ran over to Jeb. The cougar was moving its head in and out, trying to find a way through the wall. Jeb was making out of his arms. Tom swung with the knife, into the cougar’ s back. It howled horribly and ran off into the mountains.

Which of the following happened first()

A. The cougar jumped from the rock.

B. Tom struggled free of his father.

C. Jeb asked Tom to get the knife.

D. Jeb held Tom across his body.

问答题 简答题