在 Java 中,我得到了这个异常:
Exception in thread "main" java.lang.IllegalThreadStateException
at java.lang.Thread.start(Unknown Source)
at Threads4.go(Threads4.java:14)
at Threads4.main(Threads4.java:4)
这是代码:
public class Threads4 {
public static void main(String[] args){
new Threads4().go();
}
void go(){
Runnable r = new Runnable(){
public void run(){
System.out.println("foo");
}
};
Thread t = new Thread(r);
t.start();
t.start();
}
}
异常是什么意思?