Introduction to OOP: Chapter 8: The Solitaire Game [next] [previous] [audio] [real] [text]

Need Linked List of Cards

class Link {
	public Link (Object newValue, Link next)
		{ valueField = newValue; 
			nextLink = next; }

	public Object value ()
		{ return valueField; }

	public Link next ()
		{ return nextLink; }

	private Object valueField;
	private Link nextLink;
}
Intro OOP, Chapter 8, Slide 8

In a later version of this game, I eliminated the linked list class and instead used the Stack class provided by the Java standard library. See the first slide for a description of the various different versions of this program.