class Node { public int data; public Node nextOne; // Constructor public Node (int initialValue) { data = initialValue; nextOne = null; } } class ListOfInts { private Node theList; private int numElements; // Don't need a maxListSize; no limit other than memory limits. // Constructor public ListOfInts() { // Actually, the default constructor would do the same inits for us. theList = null; numElements = 0; } public void addInt (int n) { Node temp = new Node(n); temp.nextOne = theList; theList = temp; numElements++; } public float average () { Node temp = theList; int sum = 0; while (temp != null) { // Or could still use this: for (int i=0; i