how to implements an empty queue java

Solutions on MaxInterview for how to implements an empty queue java by the best coders in the world

showing results for - "how to implements an empty queue java"
Aisha
19 Jan 2018
1import java.util.*;
2 
3public class Main {
4   public static void main(String[] args) {
5    //declare a Queue   
6    Queue<String> str_queue = new LinkedList<>();
7    //initialize the queue with values
8    str_queue.add("one");
9    str_queue.add("two");
10    str_queue.add("three");
11    str_queue.add("four");
12    //print the Queue
13    System.out.println("The Queue contents:" + str_queue);
14    }
15}
similar questions
queries leading to this page
how to implements an empty queue java