title: Comparing "Queue" objects in Java
body: <p>I'm currently studying the properties of "Queue" interface and have encountered the following statement in <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Queue.html#offer-E-" rel="nofollow noreferrer">Java Documentation</a>:</p>
  
  <blockquote>
    <p>Queue implementations generally do not define element-based versions
    of methods equals and hashCode but instead inherit the identity based
    versions from class Object, because element-based equality is not
    always well-defined for queues with the same elements but different
    ordering properties.</p>
  </blockquote>
  
  <p>I'm not exactly sure the meaning of this paragraph in terms of how to compare "Queue" objects of both the same implementation type and different implementation type. Could someone please explain to me how comparing "Queue" objects is done? </p>