public class LinkedListTestProgram { public static void main(String args[]) { Item head, tail, internal; LinkedList myList = new LinkedList(); myList.add(head = new Item(23)); myList.add(new Item(65)); myList.add(new Item(87)); myList.add(internal = new Item(45)); myList.add(new Item(56)); myList.add(new Item(34)); myList.add(new Item(95)); myList.add(tail = new Item(71)); System.out.println("Here is the list: "); System.out.println(myList); System.out.println("\nThe total of the data is: "); System.out.println(myList.totalData()); System.out.println("\nRemoving the head .. here is the list now: "); myList.remove(head); System.out.println(myList); System.out.println("\nRemoving the tail .. here is the list now: "); myList.remove(tail); System.out.println(myList); System.out.println("\nRemoving internal item 45, here is the list now: "); myList.remove(internal); System.out.println(myList); } }