Complete the code to add an element to the end of the queue.
queue.[1](10);
In Java's Queue interface, add() adds an element to the end of the queue following FIFO.
Complete the code to remove the front element from the queue.
int front = queue.[1]();The poll() method removes and returns the front element of the queue or returns null if empty.
Fix the error in the code to check the front element without removing it.
int front = queue.[1]();The peek() method returns the front element without removing it, or null if empty.
Fill both blanks to create a queue and add an element 5 to it.
Queue<Integer> queue = new [1]<>(); queue.[2](5);
Use LinkedList to implement Queue and offer() to add elements safely.
Fill all three blanks to remove the front element and print the queue.
int removed = queue.[1](); System.out.println("Removed: " + [2]); System.out.println("Queue: " + [3]);
poll() removes the front element safely, then we print the removed element and the current queue.
