|
楼主 |
发表于 2005-10-25 15:46:58
|
显示全部楼层
- public class Test {
- public static void main(String[] args){
- Runnable run = new Runnable(){
- public void run(){
- try{
- Thread.sleep(Integer.MAX_VALUE);
- System.err.println("Wait End");
- }catch(InterruptedException e){
- System.err.println("Thread interrupted");
- }
- }
- };
- for(int i=0; i<10000; i++){
- Thread th = new Thread(run);
- th.start();
- System.out.println("Start thread "+i);
- }
- try{
- Thread.sleep(Integer.MAX_VALUE);
- }catch(InterruptedException e){}
- }
- }
复制代码 |
|