问题 填空题

下列程序中,实例tat是监听器,fr是事件源,fr上发生的事件委托tat进行处理。程序的执行结果是显示一个粉红色的窗口,单击关闭按钮,可关闭窗口。请填完整程序。  import java.awt.*;  importjava.awt.event.*;  public class Testppp  {   public static void main(String args[ ])   {    Frame fr=new Frame("The Adapter!”);    TheAdapterTest tat=new TheAdapterTest( );    fr  【15】      fr.setSize(200,200);    fr.setBackground(Color.pink);    fr.setVisible(true);   }  }  class TheAdapterTest extends WindowAdapter  }   public void windowClosing(WindowEvent e)   {     System.exit(1);   }  }

答案

参考答案:【15】addWindowlistener(tat);

解析:解析:WindowAdapter是窗口适配器,TheAdapterTest类继承了它。fr是Frame的对象,Frame和其子类都可以调用addWindowListener()方法。

改错题

第Ⅱ卷(共35分)

第一节、短文改错(共10小题,每小题1分,满分10分)

此题要求改正所给短文中的错误。对标有题号的每一行作出判断;如无错误在该行右边横线上画一个勾(√);如有错误(每一行只有一个错误),则按下列情况改正。

该行多一个词:把多余的词用斜线(\)划掉,在该行右边横线上写出该词,并也用斜线(\)划掉。

该行缺一个词:在缺词处加一个漏字符号(∧),在该行右边横线上写出该加的词。

该行错一个词:在错的词下划一横线,在该行右边横线上写出改正后的词。

注意:原行没有错的不要改。

When we got up in the morning every day, we start our daily         76.____________

routine: washing our faces, brushing our teeth and maybe take a bath.        77.____________

When you do this, do you ever think that there is enough water or not?  78.____________

One thirds of the 4.4 billion people in the developing world        79.____________

has no way to clean drinking water. Water-related diseases kill           80.____________

10,000 to 20,000 children every day in the developed world.              81.____________

What comes to our minds when we read these numbers?                     82.____________

Do you think we are lucky or not? In a fact, the outlook for the    83.____________

future, even for us, is not very bright. 

So let us value our water as much as possibly not only for                 84.____________

ourselves, but also to our children.                              85 .____________

多项选择题