import java.util.LinkedList; public class TestQueue { static public void main(String[] args) { LinkedList aQueue = new LinkedList(); boolean ok = true; Integer item; if (aQueue.isEmpty()) { System.out.println("The queue is empty"); } // end if for (int i = 0; i < 5; i++) { aQueue.add(i); // With autoboxing, this is the same as // aQueue.add(new Integer(i)) } // end for while (!aQueue.isEmpty()) { System.out.print(aQueue.peek()+ " "); item = aQueue.remove(); } // end while System.out.println(); } // end main } // end TestQueue