import java.util.*;
public class tt extends Thread {
timmer t = new timmer();
public tt() {
}
public tt(String n) {
this.setName(n);
}
public void run() {
t.go();
}
public static void main(String args[]) {
tt t1 = new tt("帐三");
t1.start();
tt t2 = new tt("李四");
t2.start();
}
}
class timmer {
public void go() {
synchronized (this) {
for (int i = 0; i < 1000; i++) {
try {
Thread.sleep(1);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.print(Thread.currentThread().getName());
System.out.println("取出1W元");
}
}
}
}