import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class B extends Thread{
int a=10;
@Override
public void run() {
// TODO Auto-generated method stub
synchronized ("") {
while(a>0) {
try {
Thread.sleep(1000);
} catch (Exception e) {
// TODO: handle exception
System.out.println(e.toString());
}
System.out.println("当前票数"+a--);
}
}
}
public static void main(String[] args) {
B b =new B();
new Thread(b).start();
new Thread(b).start();
new Thread(b).start();
}
}