(Queue queue)
| 7 | |
| 8 | public class QueueDemo { |
| 9 | public static void printQ(Queue queue) { |
| 10 | while(queue.peek() != null) |
| 11 | System.out.print(queue.remove() + " "); |
| 12 | System.out.println(); |
| 13 | } |
| 14 | public static void main(String[] args) { |
| 15 | Queue<Integer> queue = new LinkedList<>(); |
| 16 | Random rand = new Random(47); |