听力原文:The economist John Maynard Keynes argued that market behavior. could not be rational, or subject to improvement, since our existing knowledge did not provide a sufficient basis for a calculated mathematical expectation of investment returns.
______
查看答案
下面是一个Applet程序,其功能是有2个按钮,分别为First和Second,以及一个Label构件。要求单击First时则能在Label中显示出Command: First,而单击Second时则能显示出Command: Second,要求只能使用重载一次actionPerformed()方法。请改正程序中的错误(有下划线的语句),使程序能输出正确的结果。
注意:不改动程序的结构,不得增行或删行。
程序运行结果如下:
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
/*
<applet code=ex3_3.class width=800 height=400>
</applet>
*/
public class ex3_3 extends Applet implements ActionListener
{
private String str="ok";
private Label 1;
private Button btn;
public void init()
{
setLayout(null);
1=new Label(str);
1.reshape(10,10,150,30);
add(1);
btn=new Button("First");
btn.reshape(10,50,60,20);
1.addActionListener(this);
add(btn);
btn=new Button("Second");
btn.reshape(10,100,60,20);
btn.setActionCommand("First");
btn.addActionListener(this);
add(btn);
}
public void actionPerformed(ActionEvent ae)
{
str="Command:"+ae.getActionCommand();
btn.setText(str);
}
}
ex3_3.html
<HTML>
<HEAD>
<TITLE>ex3_3</TITLE>
</HEAD>
<BODY>
<applet code="ex3_3.class"width=800 height=400>
</applet>
</BODY>
</HTML>
注意:不改动程序结构,不得增行或删行。
package ch3;
import java.io.*;
public class Test
{
public static void main(String[] args)
{
try
{
______fos=new______("ch3/file.dat");
______
}
catch(IOException ioe)
{
ioe.printStackTrace();
}
}
}
What will cause" traffic jams" on the Internet according to Broadband companies?