

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What does the method addLast(E e) do in java?
The addLast(E e) method of the java.util.LinkedList class inserts the specified element at the end of this list.
Example:
import java.util.*; public class LinkedListDemo { public static void main(String[] args) { LinkedList list = new LinkedList(); list.add("Hello"); list.add(2); list.add("Chocolate"); list.add("10"); System.out.println("LinkedList:" + list); list.addLast("Element"); System.out.println("LinkedList:" + list); } }
Output:
LinkedList:[Hello, 2, Chocolate, 10] LinkedList:[Hello, 2, Chocolate, 10, Element]
- Related Questions & Answers
- What does the method addFirst(E e) do in java?
- What does the method addElement(E obj) do in java?
- What does the method add(E element) do in java?
- What does the method add(int i, E element) do in java?
- Consider the ambiguous grammar. E → E + E E → E * E E → (E) E → id (a) Construct LR (0) items for above grammar. (b) Construct SLR parsing table for grammar. (c) Parse the input string id + id * id.
- What is E-Governance?
- What is the difference between throw e and throw new Exception(e) in catch block in java?
- List.replaceAll(UnaryOperator<E> operator) method in Java
- Regular Expression E Metacharacter in Java.
- The "E" and "e" custom specifiers in C#
- What does the method clear() do in java?
- What does the method clone() do in java?
- What does the method firstElement() do in java?
- What does the method lastElement() do in java?
- What does the method removeAllElements() do in java?
Advertisements