code: public void put(Object o)
          throws InterruptedException
      {
          synchronized(lock)
          {
              while (size==maxSize)
                  lock.wait();
  
              elements[tail]=o;
              if(++tail==maxSize)
                  tail=0;
              size++;
              lock.notify();
          }
      }
docs: Put object in queue.
  @param o Object