为什么会有这种报错
package zh.codegym.task.task16.task1603;
import java.util.ArrayList;
import java.util.List;
/*
一个列表和几个线程
*/
public class Solution {
public static volatile List<Thread> list = new ArrayList<>(5);
public static void main(String[] args) {
//在此编写你的代码
SpecialThread st1 = new SpecialThread();
Thread t1 = new Thread(st1);
SpecialThread st2 = new SpecialThread();
Thread t2 = new Thread(st2);
SpecialThread st3 = new SpecialThread();
Thread t3 = new Thread(st3);
SpecialThread st4 = new SpecialThread();
Thread t4 = new Thread(st4);
SpecialThread st5 = new SpecialThread();
Thread t5 = new Thread(st5);
list.add(t1);
list.add(t2);
list.add(t3);
list.add(t4);
list.add(t5);
new Thread(st1).start();
new Thread(st2).start();
new Thread(st3).start();
new Thread(st4).start();
new Thread(st5).start();
}
public static class SpecialThread implements Runnable {
public void run() {
System.out.println("这是 SpecialThread 内的 run 方法");
}
}
}