问题 单项选择题

下面的描述中,正确的是( )。

A.virtual可以用来声明虚函数

B.含有纯虚函数的类是不可以用来创建对象的,因为它是虚基类

C.即使基类的构造函数没有参数,派生类也必须建立构造函数

D.静态数据成员可以通过成员初始化列表来初始化

答案

参考答案:A

解析: 在基类中用virtual声明成员函数为虚函数,所以A是正确的。纯虚函数是在声明虚函数时被“初始化”为0的虚函数。纯虚函数是一种特殊的虚函数,它没有具体的实现。静态数据成员函数只能在类外进行初始化。

阅读理解

阅读理解。

      In a great many cities, hundreds of people ride bikes to work every day. In New York, some bike riders

have even formed a group called Bike for a Better City. They declare that if more people rode bikes to work,

there would be fewer automobiles in the downtown part of the city and so less dirty air form car engines. For

several years, this group had been trying to get the city government to help bike riders.

     For example, they want the city to draw special lanes (车道) for bikes on some of the main streets, because when bike riders must use the same lanes as cars there are accidents. Bike for a Better City feels that if there

were special lanes, more people would use bikes.

      But no bike lanes have been drawn. Not everyone thinks it is a good idea-they say it will slow traffic. Some

store owners on the main streets don't like the idea-they say that if there is less traffic, they will have less business.

      The city government has not yet decided what to do. It wants to keep everyone happy. On weekends,

Central Park-the largest place open ground in New York- is closed to cars, and the roads may be used by bikes

only.

1. In New York, a group of bike riders ______.

A. are keeping practicing for health

B. have no cars of their own

C. are complaining there are not enough buses

D. are trying to settle the problem of air pollution

2. The bike riders suggest that _______.

A. bikes should be used instead of cars

B. bike lanes should be drawn

C. fewer buses or cars should be used

D. the number of special lanes should be decreased

3. The advantage of the special lanes is that _______.

A. they will make cars and buses run slowly

B. they will make it easier for bike riders to go to parks

C. they will make the city more beautiful

D. they will prevent accidents

判断题