Working with queue

Report a typo

There is a queue with four elements. Put the number 5 in it, and then take two items out of the queue.

Sample Input 1:

Sample Output 1:

[3, 4, 5]
Write a program in Java 17
import java.util.*;

public class Main {

public static void main(String[] args) {
Queue<Integer> queue = new ArrayDeque<>(Arrays.asList(1, 2, 3, 4));

// write your code here

System.out.println(queue);
}
}
___

Create a free account to access the full topic