LinkedList peek methods example

LinkedList provides 3 methods to get elements without removing it apart from the conventional get(index)

You can get the java doc for this methods Here

lets see the LinkedList peek methods example

Output