Launch offer
Business website $150 USD Custom plugin $200 USD Ready in 5 days
Get a quote
Java

LinkedList in Java

Use LinkedList for frequent insert/remove at ends or as a deque.

LinkedList in Java — a practical guide to Java LinkedList with clear examples you can reuse in real projects.

Java Tutorial Series (52/90). Prefer one article? Read the complete Java tutorial.

Short description

`LinkedList` implements List and Deque. Prefer ArrayList unless you need linked-list behavior.

LinkedList as deque

import java.util.LinkedList;

LinkedList<String> q = new LinkedList<>();
q.addLast("a");
q.addLast("b");
System.out.println(q.removeFirst());

Leave a reply

Your email address will not be published. Required fields are marked *