인큐(enQueue)
/ 프론트에서 이루어지는 삭제연산을 디큐(dnQueue)
라고 부른다.Queue<String> queue = new LinkedList<>();
//값 추가
queue.add("1");
queue.offer("2");
queue.poll(); //if queue is empty, it returns null.
queue.remove(); //remove, if queue is empty, but it throws NullException
queue.clear(); //초기화
queue.peek(); //return first value in queue.
queue.forEach(q -> System.out.println(q)); //1,2
[참고자료]
https://brightwon.tistory.com/8
https://devuna.tistory.com/22
https://coding-factory.tistory.com/602