class test implements Runnable
{
//private static int b=80;synchronized
public void run()
{
for (int i=0;i<100 ;i++ )
{
System.out.println(Thread.currentThread().getName()+"......."+"第"+i+"个");
}
}
}
class testDemo
{
public static void main(String[] args)
{
test v = new test();
Thread t1 = new Thread(v);
Thread t2 = new Thread(v);
t1.start();
t2.start();
//System.out.println("Hello World!");
}
} 作者: lwy0319 时间: 2014-4-11 15:23 本帖最后由 lwy0319 于 2014-4-11 15:30 编辑