(String[] args)
| 12 | System.out.println(); |
| 13 | } |
| 14 | public static void main(String[] args) { |
| 15 | Queue<Integer> queue = new LinkedList<>(); |
| 16 | Random rand = new Random(47); |
| 17 | for(int i = 0; i < 10; i++) |
| 18 | queue.offer(rand.nextInt(i + 10)); |
| 19 | printQ(queue); |
| 20 | Queue<Character> qc = new LinkedList<>(); |
| 21 | for(char c : "Brontosaurus".toCharArray()) |
| 22 | qc.offer(c); |
| 23 | printQ(qc); |
| 24 | } |
| 25 | } |
| 26 | /* Output: |
| 27 | 8 1 1 1 5 14 3 1 0 1 |