问题 单项选择题

下面有关Java代码安全性的叙述,( )是对的。
Ⅰ:字节码校验器加载查询执行需要的所有类。
Ⅱ:运行时解释器执行代码。
Ⅲ:在运行时,字节码被加载,验证后在解释器里面运行。
Ⅳ:类加载器通过分离本机文件系统的类和从网络导入的类增加安全性。

A.Ⅱ、Ⅲ

B.Ⅱ、Ⅲ、Ⅳ

C.Ⅰ、Ⅲ、Ⅳ

D.Ⅲ、Ⅳ

答案

参考答案:B

解析: 该题考查考生对Java程序代码安全性的掌握。Java程序运行的过程是这样的:类加载器加载程序运行所需要的所有类,它通过区分本机文件系统的类和网络系统导入的类增加安全性,这可以限制任何的特洛伊木马程序,因为本机类总是先被加载,一旦所有的类被加载完,执行文件的内存划分就固定了,在这个时候,特定的内存地址被分配给对应的符号引用,查找表也被建立,由于内存划分发生在运行时,解释器在受限制的代码区增加保护,防止未授权的访问;然后字节码校验器进行校验,主要执行下面的检查,类是否符合JVM规范的类文件格式,有没有违反访问限制,代码有没有造成堆栈的上溢或者下溢,所有操作代码的参数类型是否都是正确的,有没有非法的数据类型转换(例如将整型数转换成对象类型)发生;校验通过的字节码被解释器执行,解释器在必要时通过运行时系统执行对底层硬件的相应调用。

阅读理解

Police fired tear gas and arrested more than 5,000 passively resisting protestors Friday in an attempt to break up the largest antinuclear demonstration ever staged in the United States. More than 135,000 demonstrators confronted police on the construction site of a 1,000-megawatt nuclear power plant scheduled to provide power to most of southern New Hampshire. Organizers of the huge demonstration said, the protest was continuing despite the police actions. More demonstrators were arriving to keep up the pressure on state authorities to cancel the project. The demonstrator had charged that the project was unsafe in the densely populated area, would create thermal pollution in the bay, and had no acceptable means for disposing of its radioactive wasters. The demonstrations would go on until the jails and the courts were so overloaded that the state judicial system would collapse.

Governor Stanforth Thumper insisted that there would be no reconsideration of the power project and no delay in its construction set for completion in three years. “This project will begin on time and the people of this state will begin to receive its benefits on schedule. Those who break the law in misguided attempts to sabotage the project will be dealt with according to the law,” he said. And police called in reinforcements from all over the state to handle the disturbances.

The protests began before dawn Friday when several thousand demonstrators broke through police lines around the cordoned-off construction site. They carried placards that read “No Nukes is Good Nukes,” “Sunpower, Not Nuclear Power,” and “Stop Private Profits from Public Peril.” They defied police order to move from the area. Tear gas canisters fired by police failed to dislodge the protestors who had come prepared with their own gas masks or facecloths. Finally gas-masked and helmeted police charged into the crowd to drag off the demonstrators one by one. The protestors did not resist police, but refused to walk away under their own power. Those arrested would be charged with unlawful assembly, trespassing, and disturbing the peace.

小题1:What were the demonstrators protesting about?

[A] Private profits.

[B]Nuclear Power Station.

[C] The project of nuclear power construction.

[D] Public peril.

小题2:Who had gas-masks?

[A] Everybody.

[B]A part of the protestors.

[C] Policemen.

[D] Both B and C.

小题3:.Which of the following was NOT mentioned as a reason for the demonstration?

[A] Public transportation.

[B]Public peril.

[C] Pollution.

[D] Disposal of wastes.

小题4:.With whom were the jails and courts overloaded?

[A] With prisoners.

[B]With arrested demonstrators.

[C] With criminals.

[D] With protestors.

小题5:What is the attitude of Governor Stanforth Thumper toward the power project and the demonstration?

[A] stubborn.

[B]insistent.

[C] insolvable.

[D] remissible.

Vocabulary

1.tear gas          瓦斯

2.passively resisting protestor    不抵抗的抗议者

3.stage          发起,举行,上演

4.break up             驱散,终止

5.cordon          警戒线,警戒

6.nuke          (美俚)核武器,核电站

7.defy          公然蔑视/反抗

8.canister       罐,筒,榴霰弹筒

9.islodge          赶走

10.charge          冲锋,向前冲

11.trespass       非法侵入,扰乱

单项选择题