how to iterate a queue in java code example
Example: how to iterate a queue in java
Queue queue = new LinkedList();
queue.add(1);
queue.add(2);
queue.add(3);
for (Integer item: queue) {
System.out.println(item);
}