title: A way to signal that something has happened
body: <p>I have an ArrayList called queue where I store the Customers in a Supermarket as they arrive to the checkout. When they have paid, I remove the first element of the Arraylist (the Customer that was first on the queue), but I don't know how to tell the second one, that now is the first, to proceed to pay. In addition, this Customer should be waiting for an "event".</p>
  
  <p>To sum up, I'm looking for something like a "signal" and "wait".</p>
  
  <p>Here is an outline of what I have:</p>
  
  <pre><code>public class Customer{
      public void checkItems(){
      //Here goes the code for waiting his turn
      //Here goes the code for paying items (already done)
      //The next line is how I remove the client of the queue
      Globals.checkoutList.get(currentCheckout).queue.remove(0);
      Checkout.nextCustomer();
      }
  }
  
  public class Checkout{
      public static void nextCustomer(){
      //Here I should tell the next customer that it is his turn
      }
  }
  </code></pre>
  
  <p>Regards and thanks.</p>
  
  <p>EDIT: maybe using Exceptions? Help with exceptions will be appreciated too.</p>