What is the difference between wait/notify and wait/interrupt?
问题 synchronized (Foo.class) { while (someCondition) { try { Foo.class.wait(); } catch (InterruptedException e) { e.printStackTrace(); } } } It seems that this thread both wakes when some other thread call interrupt() or notify() on this thread. Are there any differences between the two? --EDIT-- I know one is for notifying an object, the other interrupts a thread. But both of these lead to the same consequence, that is, this thread is waken up, so what I want to ask is how these 2 situations'