Thread threads[] = new Thread[100];是一个数组,下面的代码写错了,应该都是threads[i]调用数组中的线程类对象才对,现在的代码运行肯定报错的
threads = new JoinThread();
threads.start();
threads.join();
改为:
threads[i] = new JoinThread();
threads[i].start();
threads[i].join();