title: Iterate through Queue of Objects in Order
body: <p>I have created a queue containing objects which I would like to iterate through in the order that they were placed within the queue (First object placed in queue, 2nd object placed in queue, 3rd object...)</p>
  
  <p>I saw a way of doing this online but I'm not sure if this will guarantee that objects in the queue will be visited in the correct order?</p>
  
  <pre><code>for(MyObject anObject : queue){
      //do someting to anObject...
  </code></pre>
  
  <p>Thank you for your help.</p>