Java Queue create from Deque

Description

Java Queue create from Deque


import java.util.ArrayDeque;
import java.util.Deque;

public class Main {
  public static void main(String args[]) {
    Deque<String> queue = new ArrayDeque<String>();

    queue.add("CSS");
    queue.add("HTML");
    queue.add("Java");
    queue.add("Javascript");
    while (!queue.isEmpty()) {
      System.out.println(queue.remove());
    }/*from w  w  w.j ava 2 s  .c  o  m*/

  }
}



PreviousNext

Related