java的线程
package com.test; public class Test { public static void main(String[] args) { // TODO Auto-generated method stub for(int i=0;i<100;i++){ ThreadTest tt = new ThreadTest(); Thread t = new Thread(tt); t.start(); } } } /** * 通过实现Runnable接口创建一个线程 */ class ThreadTest implements Runnable { public void run() { System.out.println("I'm running!="+Thread.currentThread().getId()); } }