public class MyThread implements Runnable {   public void run(){   }
}
public static void main(String args[]) {   for ( int i=0;i<100;i++) {
        Thread t = new Thread(new MyThread());
        t.start();
   }
}OK

解决方案 »

  1.   

    for(int i=0;i <100;i++ ){ 
      new Thread(){
        public void run(){
    ............
    ..................   
        }
      }.start();
    }
      

  2.   

    一般对多线程的处理都是用线程池.那个东西对多线程的处理提供了很多线程安全的处理.
    以下是一段简单的代码.仅供参考.import java.util.concurrent.LinkedBlockingQueue;
    import java.util.concurrent.ThreadPoolExecutor;
    import java.util.concurrent.TimeUnit;public class TestThread implements Runnable {
    public static int num = 0;
    public void run() {
    System.out.println(num++);
    }

    /**
     * @param args
     */
    public static void main(String[] args) {
    ThreadPoolExecutor threadPoolExecutor = new
      ThreadPoolExecutor(10,10,0, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>());
    for (int i = 0; i < 100; i++) {
    TestThread testThread = new TestThread();
    threadPoolExecutor.execute(testThread);
    }
    }
    }
      

  3.   

    public class MyThread implements Runnable {   public void run(){   } 

    public static void main(String args[]) {   for ( int i=0;i <100;i++) { 
            Thread t = new Thread(new MyThread()); 
            t.start(); 
      } 

      

  4.   

    这东西哪能直接说对错,要看语义环境。(楼主的语句都写错了,start又不是Thread的静态方法,怎么能直接调用,笔误?)
    但存要开100个线程来运行,当然直接创建就行,如一个单机的处理代码,测试100个线程下的并行处理。
    如果要100个线程反复使用,则需要用线程池,如服务器代码的服务端处理。
      

  5.   

    100个线程还用线程池?不用了吧,线程组就可以了,普通创建,等待n ms创建就可以了,线程池不用用thread作参数的runnable就可以了,线程池用来处理任务的