VOOZH about

URL: https://www.geeksforgeeks.org/java/linkedlist-addlast-method-in-java/

⇱ LinkedList addLast() Method in Java - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

LinkedList addLast() Method in Java

Last Updated : 11 Jul, 2025

In Java, the addLast() method of the LinkedList class is used to add an element at the end of the list.

Syntax of LinkedList addLast() Method

void addLast( E e)

  • Parameter:e is the element you want to add at the end of the list.
  • Return type: This method does not return any value.

Example: Here, we use the addLast() method to add elements at the end of the LinkedList.


Output
The LinkedList is: [Geeks, for, Geeks]
The new LinkedList is: [Geeks, for, Geeks, is, the, best, Coding, Platform]
Comment