问题 单项选择题

定义一个表示10个值为null的字符串数组,下面选项正确的是( )。

A.String[]a;
B.String a[];
C.chara[10][];
D.String a[]=new String[10];

答案

参考答案:D

解析: 本题考查字符串数组变量的声明。选项A和选项B的效果是一样的,都是用来定义一个字符串数组,但没有指明数组个数,不满足题目要求;选项C是一个二维的字符数组,在C语言中,一个二维的字符数组就可以表示一个一维的字符串数组,而在Java中,字符char是基本类型,字符串String则是以对象的形式来表示的;选项D正确,它定义了一个含有10个元素的字符串数组,如果没有给字符串数组赋值,则默认为null。

单项选择题
阅读理解

阅读理解。

OUR PROMISE

     Making your stay a complete success is our goal. Just let our manager on duty of front-desk staff know

if any part of your stay isn't satisfactory. We promise to make it right or you won't pay for that part of your

stay.

FORGET SOMETHING?

     If you forget to pack any standard toiletry item(tooth brush, toothpaste, shaving cream, razor or comb),

just call the front-desk and we'll get you a free replacement right away.

PLEASE REUSE THE TOWELS

     We invite you to join with us to save water by using your towels more than once.

     In addition to decreasing water and energy waste, you can help us reduce the amount of waste water that

must be recycled within our community.

     Please hang the towels up if you wish to join in the program-if not, simply leave them on the floor. We

appreciate your help!

PLEASE CHANGE THE SHEETS TODAY

     The Project Planet Program is an effort of this hotel to protect the environment by saving water and

decreasing waste water. If you are staying with us more than one night, as part of the Project Planet Program,

we will wash your sheets every three days.

     If you would prefer not to join in this program, simply hang this card on the outside of your door and

sheets will be changed right away. As always sheets are automatically changed after every guest checks out.

     We appreciate your help!

1. We can find this passage in a _____ in a hotel. [ ]

A. café bar

B. front-desk

C. fitness center

D. guest room

2. If you forget your comb, you can _____. [ ]

A. buy one in the hotel shop

B. replace one with a tooth brush

C. phone the front-desk to get one

D. go in person and get one at the front desk

3. Leaving the towels on the floor means that _____. [ ]

A. you want to join in the program

B. you want the room-maid to hang it up

C. you need them collected and washed

D. you want to use them more than once

4. What is the Project Planes Program trying to do? [ ]

A. Make your bed sheets cleaner.

B. Work for a better environment.

C. Help guests checking out faster.

D. Persuade guests to stay longer.