以下命令中对已经打开的索引文件进行查找的命令为()。

A:SEEK B:FOUND C:CONTI D:SORT

“guAngdong-Conti”原产于哪个国家?()

A:冰岛 B:法国 C:中国 D:意大利

RoaldDahl,在MyUncleOawald一书中写到“品尝这款葡萄酒让嘴和鼻子同时达到了快感和高潮。这款葡萄酒指的是:()

A:罗曼尼康帝(Romanee-Conti) B:依肯(Chateaud’Yquem) C:玛歌(ChateauMargaux)

下面程序是一个计时器,从1000秒开始倒计时,直到为0结束。在界面上有两个按钮,一个可以暂停计时,另一个可以继续已经暂停的计时。请更正题中带下划线的部分。
注意:不改动程序的结构,不得增行或删行
import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
public class Example3_4 extends Applet

public Color color = Color.red;
private int num= 1000;
public Counter theCounter;
private Button stop;
private Button start;
public void init( )

stop = new Button("暂停");
start = new Button ("继续");
theCounter = new Counter(this);
stop.addActionListener(new Lst( ) implements ActionListener
public void actionPerformed(ActionEvent e)

theCounter.sus( );

);
start.addActionListener(new SuspenListener( ));
add(start);
add(stop);
theCounter.start( );

public void paint(Graphics g)

g.setCotor(color);
g.drawString(String.valueOf(num),50,50);

public void setInt(int i)

num=i;

class SuspenListener implements ActionListener

public void actionPerformed(ActionEvent e)

theCounter.conti ( );



public class Counter extends Thread

Example3_4 example;
boolean isHold;
Counter (Example3_4 ex)

this.example = ex;
isHold = false;

public void sus( )

isHold = true;

public synchronized void conti( )

isHold = false;
notify( );

public void run( )

for (int i = 1000; i>0; i--)

if (i%2 == 1)
example.color = Color.red;
else
example.color = Color.blue;
example.setInt(i);
example.repaint( );
try

sleep(1000);
synchronized
while(isHold)
wait ( );


catch (InterruptedException ie)




<HTML>
<HEAD>
<TITLE>Example3_4</TITLE>
</HEAD>
<BODY>
<applet code="Example3_4.class" width=300 height=400>
</applet>
</BODY>
</HTML>

①stop.addActionListener(new ActionListener(){
②class Counter extends Thread
③synchronized(this)

下面程序是一个计时器,从1000秒开始倒计时,直到为0结束。在界面上有两个按钮,一个可以暂停计时,另一个可以继续已经暂停的计时。请更正题中带下划线的部分。 注意:不改动程序的结构,不得增行或删行 import java.awt.*; import java.awt.event.*; import java.applet.Applet; public class Example3_4 extends Applet { public Color color = Color.red; private int num= 1000; public Counter theCounter; private Button stop; private Button start; public void init( ) { stop = new Button("暂停"); start = new Button ("继续"); theCounter = new Counter(this); stop.addActionListener(new Lst( ) implements ActionListener{ public void actionPerformed(ActionEvent e) { theCounter.sus( ); } }); start.addActionListener(new SuspenListener( )); add(start); add(stop); theCounter.start( ); } public void paint(Graphics g) { g.setCotor(color); g.drawString(String.valueOf(num),50,50); } public void setInt(int i) { num=i; } class SuspenListener implements ActionListener { public void actionPerformed(ActionEvent e) { theCounter.conti ( ); } } } public class Counter extends Thread { Example3_4 example; boolean isHold; Counter (Example3_4 ex) { this.example = ex; isHold = false; } public void sus( ) { isHold = true; } public synchronized void conti( ) { isHold = false; notify( ); } public void run( ) { for (int i = 1000; i>0; i--) { if (i%2 == 1) example.color = Color.red; else example.color = Color.blue; example.setInt(i); example.repaint( ); try { sleep(1000); synchronized { while(isHold) wait ( ); } } catch (InterruptedException ie) {} } } } <HTML> <HEAD> <TITLE>Example3_4</TITLE> </HEAD> <BODY> <applet code="Example3_4.class" width=300 height=400> </applet> </BODY> </HTML>

微信扫码获取答案解析
下载APP查看答案解析