Java examples for Collection Framework:LinkedList
Adding Items to a LinkedList with add method
import java.util.LinkedList; public class Main { public static void main(String[] args) { LinkedList<String> officers = new LinkedList<String>(); officers.add("Blake"); officers.add("Mary"); officers.add("Edith"); officers.add("P"); officers.add("Lady"); for (String s : officers) System.out.println(s);/*from www. j a v a 2s.co m*/ } }