public class Queue { private DVListe queue = new DVListe(); public void offer(Object o) { this.queue.addLast(o); } public Object poll() { Object o = this.queue.getFirst(); if (o != null) { this.queue.removeFirst(); } return o; } public Object peek() { return this.queue.getFirst(); } public static void main(String[] args) { Queue q = new Queue(); q.offer("1"); q.offer("2"); q.offer("3"); q.offer("4"); q.offer("5"); System.out.println(q.peek()); System.out.println(q.peek()); System.out.println(); System.out.println(q.poll()); System.out.println(q.poll()); System.out.println(q.poll()); System.out.println(q.poll()); System.out.println(q.poll()); System.out.println(); System.out.println(q.poll()); System.out.println(q.peek()); } }