// LinkedList3.java class LinkedList { // a Node of the list private class Node { public Type data; public Node next; } // the head of the list is first node private Node head; // the list starts empty public LinkedList() { head = null; } // add a new item to the front of the list public void add(Type item) { Node newNode = new Node(); newNode.data = item; newNode.next = head; head = newNode; } // print the list from start to finsih public void print() { Node current = head; while (current != null) { System.out.println(current.data); current = current.next; } } } public class LinkedList3 { public static void main(String args[]) { // make a list of some numbers LinkedList numbers = new LinkedList(); for (int i = 0; i <= 100; i += 10) { numbers.add(i); } // print it out numbers.print(); } }