Java Wait and Notify: IllegalMonitorStateException
问题 I don't completely understand how wait and notify (of Object ) work, and as a result I'm forced to slim down my attempts into the following section of code. Main.java: import java.util.ArrayList; class Main { public static Main main = null; public static int numRunners = 4; public static ArrayList<Runner> runners = null; public static void main(String[] args) { main = new Main(); } Main() { runners = new ArrayList<Runner>(numRunners); for (int i = 0; i < numRunners; i++) { Runner r = new