问题 单项选择题

声明异常抛出用下列哪个子句来完成声明,它包含在方法的声明当中

A. throws

B. throw

C. Throwable

D. Exception

答案

参考答案:A

解析:在Java语言中,有时一个方法生成一个异常,但该方法并不能确定如何处理此异常,如找不到文件之类的异常,必须将异常传给调用方法,由凋用它的方法来处理,这种时候方法用声明异常抛出,让异常对象可从调用栈向后传递,直至有相应的方法捕获它。声明异常抛出用throws子句来完成声明,throws子句包含在方法的生命之中。语法如下:throws exceptionList//异常列表是用逗号分隔的多个异常NULL

阅读理解

There are many colors in nature. But do you know if a color has weight? I think you’ll say “no”. But I am afraid you are wrong. If you don’t believe, you may do a small experiment.

First, put two objects with the same weight into two boxes. Then cover the box. Third, wrap one box with a red piece of paper, the other with a white piece of paper. OK. Now hold the boxes with your hand one by one. It is certain that you will think the red one is a little heavier.

Why do you think so? A scientist found that different colors have different weight in a man’s mind. So he did many tests and at last he got the result. That is to say, every color has its own weight in our mind and their order is the same. The heaviest color is red, then blue, green, orange, yellow and white.

The scientist told us that colors also have smell. Can you smell the color? Of course not. Then why did the scientist say so? That is because every color stands for a kind of light with a certain wavelength. It reaches our brain through sense organs.

According to this discovery, scientists say that people accept the colors they like, and refuse the colors they hate. So your body and mind will be healthy by using the colors you like. Or you’ll be nervous or even get ill. For example, if you stay in a room with red windows, wallpapers and furniture for two hours, you’ll feel you have been there for four hours. But if the room is blue,  you’ll feel you have been there for only an hour. Another example, if a person walks out of a red room and into a blue room, his temperature will fall. That means our body temperature will change with different colors.

小题1:The purpose of the second paragraph is to tell us ___________.

A.a red box is heavier than a white one

B.a color has weight in one’s mind

C.white paper is lighter than red paper

D.you can know the weight of a color by holding it小题2:Why did the scientist say colors have smell?

A.Because people can sense the light from colors.

B.Because we can smell colors with our nose.

C.Because every color has its own sweet smell.

D.Because every color can give off light of the same length.小题3:It can be implied from the text that ___________.

A.colors have orders in weight

B.colors can change the weight of an object

C.people would stay longer in a room with red windows

D.colors can affect our mood and health小题4:This passage is probably a ___________.

A.book review

B.fiction novel

C.fairy tale

D.science report

问答题 计算题