java模拟多线程

 public class HTTPRequest  implements Runnable {

      public void run() {

       //这里实现发送请求

}

 

  public static void main(String[] args) {

  ExecutorService service = Executors.newFixedThreadPool(50);

  for (int i = 0; i < 50; i++)

     service.execute(new HTTPRequest ());//并发50个用户

     

}

}

原文地址:https://www.cnblogs.com/GodZhe/p/8867769.html