问题 填空题

[说明]
下面程序定义了一个类Point及其成员函数,然后从类Point派生出类Circle及其成员函数。
[Java程序]
class Mainjava
public static void main (String arg[])
Circle c=new Circle(2.5,3.7,4.3);
System.out.println(" X coordinate is "+c.getX()
+"\nRadius is: "+c.get Radius());
(1) ; //设置新的圆心(2,2)
Point pRef=c;
System.out.println("\n Circle printed as a point is : "
+"["+ (2) +"."+ (3) +"]"):


class Point
protected double x,y;
public Point (double a, double b) x = a; y = b;)
void setPoint (double a, double b) x = a; y = b;
final double getX () return x;
final double getY () return y;

class Circle (4)
protected double radius;
public Circle(double r, double a, double b)
(5) ;
radius=r ;
void setRadius (double r) radius=r;
final double getRadius () return radius;
final double area () return 3.14159*radius*radius;

答案

参考答案:super(a,b)

解析: 本题以Java语言为载体,考查面向对象程序设计中的几个重要概念——派生类型,构造函数,以及对象的引用。
首先,根据题中说明Circle类继承自Point,故空(4)处应填extends Pointo而类Point没有默认构造函数,派生类构造函数首先需要初始化基类,方法是在派生类构造函数的第一个语句用super引用调用基类相应派生类,故空(5)处应填super(a,b)。
主函数中空(1)处我们根据题目给出的说明,要求重新设置圆心为(2,2),调用基类设置点的函数setPoint,所以空(1)处应填入c.setPoint(2,2)。最后考察的是对象的引用,派生类对象可以初始化基类引用,在这种情况下,只能访问从相应基类中继承来的成员,而不允许访问从其他基类的成员或在派生类中增加的成员,所以,空(2)处应填入pRef.getX(),空(3)处应填入pRef.getY()。

填空题
阅读理解

When you get in your car, you reach for it. When you're at work, you take a break to have a moment alone with it. When you get into a lift, you play with it.

Cigarette? Cup of coffee? No, it's the third most addictive thing in modem life, the cell phone. And experts say it is becoming more difficult for many people to curb their longing to hug it more tightly than most of their personal relationships.

The costs are becoming more and more evident, and I don't mean just the monthly bill. Dr. Chris Knippers, a counselor at the Betty ford Center in Southern California, reports that the overuse of cell phones has become a social problem not much different from other harmful addictions: a barrier to one-on-one personal contact, and an escape from reality. Sounds extreme, but we' ve all witnessed the evidence: The person at a restaurant who talks on the phone through an entire meal, ignoring his kids around the table; the woman who talks on the phone in the car, ignoring her husband; the teen who texts messages all the way home from school, avoiding contact with kids all around him. Jim Williams, an industrial sociologist based in Massachusetts, notes that cell - phone addiction is part of a set of symptoms in a widening gulf of personal separation. He points to a study by Duke University researchers that found one-quarter of Americans say they have no one to discuss their most important personal business with. Despite the growing use of phones, e - mail and instant messaging, in other words, Williams says studies show that we don't have as many friends as our parents.  " Just as more information has led to less wisdom, more acquaintances via the Internet and cell phones have produced fewer friends," he says.

If the cell phone has truly had these effects, it's because it has become very widespread. Consider that in 1987, there were only l million cell phones in use.  Today, something like 300 million Americans carry them. They far outnumber wired phones in the United States.

小题1: From the first two paragraphs, we can know________.

A.cell phones have become as addictive as cigarettes

B.cell phone addiction is good for building personal relationships

C.people are longing to have their own cell phones

D.cell phones are the same as cigarettes小题2:Cell phone addiction has caused the following effects EXCEPT________  .

A.a barrier to personal contact

B.fewer friends

C.an escape from reality

D.a serious illness小题3: The underlined word "curb" in Paragraph 2 means “________. ”

A.ignore

B.control

C.develop

D.rescue小题4:The example of a woman talking on the phone in the car supports the idea that________  .

A.women Use cell phones more often than men

B.talking on the phone while driving is dangerous

C.cell phones do not necessarily bring people together

D.cell phones make one - on - one personal contact easy小题5:Which of the following is the best title for the passage?

A.Cell phones Are the New Cigarettes

B.Cell phones Are Harmful to the Society

C.The New Report about the Cell phone

D.The Disadvantages of the Cell phone