There is a queue with four elements. Put the number 5 in it, and then take two items out of the queue.
Queue
Working with queue
Report a typo
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);
}
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.