问题 问答题

New York is one of the most exciting cities in the world.

You might want to do some shopping in New York. Fifth Avenue is probably New York’s most famous shopping street, but if you go, be prepared to "window shop" only. This is shopping for the rich. There are other, less expensive shopping areas nearby, and you’ll soon find famous stores such as Bloomingdale’s, Macy’s and FAO Schwartz. And if you’ve brought your rollerblades(滑板), then a visit to Central Park is a must. This is a large, open park right in the middle of Manhattan, but if you thought that people came here to relax, then you’d be wrong. Nobody sits in Central Park: they run, jog(慢跑), and most of all they rollerblade.

When you leave New York, you might be tired, but the one thing you won’t be is bored!

What do people often do in Central Park

答案

参考答案:

They run, jog and rollerblade.

填空题

阅读下列说明和Java代码,将应填入 (n) 处的字句写在对应栏内。

[说明]

某软件公司现欲开发一款飞机飞行模拟系统,该系统主要模拟不同种类飞机的飞行特征与起飞特征。需要模拟的飞机种类及其特征如表18-7所示。

为支持将来模拟更多种类的飞机,采用策略设计模式(Strategy)设计的类图如图18-22所示。

在图18-22中,AirCraft为抽象类,描述了抽象的飞机,而类Helicopter、AirPlane、Fighter和Harrier分别描述具体的飞机种类,方法fly()和takeOff()分别表示不同飞机都具有飞行特征和起飞特征;类FlyBehavior与TakeOffBehavior为抽象类,分别用于表示抽象的飞行行为与起飞行为;类SubSonicFly与SuperSonicFly分别描述亚音速飞行和超音速飞行的行为;类VerticalTakeOff与LongDistanceTakeOff分别描述垂直起飞与长距离起飞的行为。

[Java代码]

interface FlyBehavior

public void fly();

class SubSonicFly implements FlyBehavior

public void fly()System.out.println("亚音速飞行!");

class SuperSonicFly implements FlyBehavior

public void fly()System.out.println("超音速飞行!");

interface TakeOffBehavior

public void takeOff();

class VerticalTakeoff implements TakeOffBehavior

public void takeOff()System.out.println("垂直起飞!");

class LongDistanceTakeOff implements TakeoffBehavior

public void takeOff()System.out.println("长距离起飞!");

abstract class AirCraft

protected (1)

protected (2)

publiC void fly() (3)

public void takeOff() (4) ;;

class Helicopter (5) AirCraft

publiC Helicopter()

flyBehavior=new (6)

takeOffBehavior=new (7)

//其他代码省略

(2)处填()。

单项选择题