queue: FIFO,
Queue is interface, the implementation could be LinkedList or array
offer, poll, peek, size() isEmpty()
public class QueueTest { public static void main(String[] args){ Queue<Integer> queue = new LinkedList<>() ; queue.offer(5); queue.offer(3); System.out.println(queue.size()); //2 System.out.println(queue.poll()); //5 System.out.println(queue.peek()); //3 System.out.println(queue.isEmpty()); //false System.out.println(queue.poll()); //3 System.out.println(queue.isEmpty()); //true } }