This method of the Queue Class obtains the number of elements in the queue.
public synchronized int size();
Returns the size of the queue (in elements).