Java Exception java.lang.IllegalThreadStateException
anonymous-class, java, multithreading
Solution
You're trying to start the thread twice.
Problem
In Java, I am getting this Exception: ``` 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) ``` Here is the code: ``` 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(); } } ``` What does the exception mean?