问题 单项选择题

StringBuffer类字符串对象的长度是

A.固定

B.必须小于16个字符

C.可变

D.必须大于16个字符

答案

参考答案:C

解析: StringBuffer是动态构造字符串的类,它能根据字符串长度动态分配内存,且它的实现是同步的。与之对应的是StringBuilder,此类并不保证同步,但占用资源更少且执行速度更快,是JDK1.5新增的类。

填空题
阅读理解

Do you still remember the disaster(灾难)several years ago? In Indonesia (印度尼西亚) thousands of people were killed by the tsunami(海啸) that washed people out to sea and pulled children out of their parents’ arms. “The weather was fine with no clouds .There was no warning and suddenly the sea water just hit the city. In some parts the water was as high as two meters.” a man in the city said. “Sadli, an official at the hospital, said many of the dead in the city were children under the age of ten.” “Maybe the children were being carried by their hold but they fell over in the water and couldn’t hold on to their children .All the dead children drawed.” said Sadli. Officials said hundreds of houses had been swept away the force (力量) of five –meter –high waves across Aceh, which lies on the northern tip (末端)of Sumatra Island . “Tens of people saw the rushing water and didn’t run to high ground .Instead, they kept watching it .Several of my workmates are missing.”  Lelana said by telephone.

小题1:According to the passage, ______were missing in the tsunami.

A.some officials

B.some of Sadli’s friends

C.some children under the age of ten

D.some of Lelana’s workmates小题2:In the tsunami, ____ _swept away hundreds of houses.

A.huge waves

B.strong winds

C.heavy rain

D.rushing river water小题3:“…. There was no   warning and suddenly the sea water was as high as two meters.”“Warning”here means ________.

A. 预兆       B. 借鉴       C 教导          D 教训

小题4:“…but they fell over in the water and couldn’t hold on to their children.”

“They”here refers to ______.

A. officials   B children

C. the dead   D. the children’s parents

小题5:Some people saw the rushing water and didn’t run to high grounds because _____.

A.they couldn’t run fast

B.the ground was too high to reach

C.they didn’t know they were in danger

D.the rushing water stopped them from running.