package Writer;
import java.io.BufferedWriter;
import java.io.IOException;
public class Writer {
}
class SpeakThread extends Thread
{
BufferedWriter bw;
public SpeakThread(BufferedWriter b)
{
bw=b;
}
public void run()
{
for(int i=1;i<=100;i++)
{
System.out.print(i+"[1],");
try {
bw.write(String.valueOf(i)+"[1],");
} catch (IOException e) {
// TODO 自动生成的 catch 块
e.printStackTrace();
}
}
}
}
class Speak implements Runnable
{
BufferedWriter bw;
public Speak(BufferedWriter b)
{
bw=b;
}
public void run() {
for(int i=1;i<=100;i++) {
System.err.print(i+"[2],");
try {
bw.write(String.valueOf(i)+"[2],");
} catch (IOException e) {
// TODO 自动生成的 catch 块
e.printStackTrace();
}
}
}
}