All pastes #837784 Raw Edit

Anonymous

public java v1 · immutable
#837784 ·published 2007-12-29 22:24 UTC
rendered paste body
public class tester {	public static void main(String[] args) throws Exception	{		test1 t = new test1();		t.start();		System.out.println("bbb");		t.notify();	}}class test1 extends Thread{	public void run()	{		try{				while( true )				{					synchronized (this) {					System.out.println("a");					wait(1000);					}				}		} catch (InterruptedException e) { System.out.println("c"); return; }	}}////////// OUTPUT: //////////////Exception in thread "main" java.lang.IllegalMonitorStateExceptionbbba	at java.lang.Object.notify(Native Method)	at tester.main(tester.java:9)aaaaaa(Kept outputting 'a's until I manually interrupted it [from the keyboard, that is].)