title: Difference between PriorityQueue and Queue Implementation in Java
body: <p>I am making an implementation of an array based priorityQueue, via this interface: </p>
  
  <pre><code>public interface IPriorityQueue {
  
  /**
   * Adds an element to the queue.
   *
   * @param element the element to be queued
   * @throws QueueFullException if there is no room in the queue for the new element
   */
  void enqueue(Comparable element) throws QueueFullException;
  
  /**
   * Removes the largest element.
   *
   * @return the element removed
   * @throws QueueEmptyException if the queue is empty
   */
  Comparable dequeue() throws QueueEmptyException;
  
  /**
   * Returns the number of elements in the queue.
   * @return the number of elements in the queue
   */
  int size();
  
  /**
   * Checks whether the queue is empty.
   * @return true if the queue is empty
   */
  boolean isEmpty();
  
  /**
   * Removes all elements from the queue.
   */
  void clear();}
  </code></pre>
  
  <p>I would like to know what are the fundamental differences when implementing these methods if I were to use an array-based queue of generic objects instead.</p>