问题1:运行结果出错,是什么意思?
问题2:此题能不能用类名.class锁?怎么用?
运行结果如下:
Exception in thread "Thread-0" Mike.....man
Exception in thread "Thread-1" java.lang.IllegalMonitorStateException
at java.lang.Object.notify(Native Method)
at Input.run(ResourceDemo2.java:46)
at java.lang.Thread.run(Thread.java:722)
java.lang.IllegalMonitorStateException
at java.lang.Object.notify(Native Method)
at Output.run(ResourceDemo2.java:73)
at java.lang.Thread.run(Thread.java:722)