Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to iterate a queue in java

Queue<Integer> queue = new LinkedList<Integer>();
        queue.add(1);
        queue.add(2);
        queue.add(3);
 
        for (Integer item: queue) {
            System.out.println(item);
        }
 
PREVIOUS NEXT
Tagged: #iterate #queue #java
ADD COMMENT
Topic
Name
1+3 =