April 05
Prde. Ismael H. F. Santos -  ismael@tecgraf.puc-rio.br                                                          2
Exemplo Queue
nRelógio de Contagem Regressiva
npublic class Countdown {
n   public static void main(String[] args) throws InterruptedException {
n      int time = Integer.parseInt(args[0]);
n      Queue<Integer> queue = new LinkedList<Integer>();
n      for (int i = time; i >= 0; i--)
n           queue.add(i);
n      while ( !queue.isEmpty() ) {
n          System.out.println(queue.remove());
n          Thread.sleep(1000);
n      }
n   }
n}