Why does this method throw an IllegalMonitorStateException?
- by kunjaan
public static synchronized void main(String[] args) throws InterruptedException {
Thread t = new Thread();
t.start();
System.out.print("X");
t.wait(10000);
System.out.print("Y");
}
What is the problem with this method?
How can I avoid such problems from now on?