Answers for "how to implements an empty queue java"

0

how to implements an empty queue java

import java.util.*;
 
public class Main {
   public static void main(String[] args) {
    //declare a Queue   
    Queue<String> str_queue = new LinkedList<>();
    //initialize the queue with values
    str_queue.add("one");
    str_queue.add("two");
    str_queue.add("three");
    str_queue.add("four");
    //print the Queue
    System.out.println("The Queue contents:" + str_queue);
    }
}
Posted by: Guest on February-18-2021

Code answers related to "how to implements an empty queue java"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language