LinkedList has methods called addFirst(), addLast(), getFirst(), getLast(), removeFirst(), and removeLast(). import java.util.LinkedList; public class MainClass { public static void main(String[] argv) { LinkedList list = new LinkedList(); list.addFirst("1"); list.addLast("2"); System.out.println(list); } }
[1, 2]