test3 t = new test3("A");
test3 t1 = new test3("B");
test3 t2 = new test3("C");
这里声明一次就可以了,至于线程名字可以这样
Thread thread1 = new Thread(t,"A");
Thread thread2 = new Thread(t1,“B”);
Thread thread3 = new Thread(t2,“C”);
修改后
test3 t = new test3();
Thread thread1 = new Thread(t,"A");
Thread thread2 = new Thread(t1,"B" );
Thread thread3 = new Thread(t2,"C" ); |