Java LinkedList.peek()

Java LinkedList.peek() is a method in the Java LinkedList class that retrieves, but does not remove, the first element of the list, returning null if the list is empty. It is commonly used in queue-like structures. Introduced in Java 1997 with Java 1.2, peek() is essential for accessing the head of the list without altering its structure.

https://docs.oracle.com/javase/8/docs/api/java/util/LinkedList.html