FileDocCategorySizeDatePackage
ToyStack.javaAPI DocExample597Sun Mar 07 18:44:20 GMT 2004None

ToyStack

public class ToyStack extends Object
Toy Stack.
version
$Id: ToyStack.java,v 1.4 2004/03/08 00:44:19 ian Exp $

Fields Summary
protected int
MAX_DEPTH
The maximum stack depth
protected int
depth
The current stack depth
protected int[]
stack
Constructors Summary
Methods Summary
protected intpeek()

		return stack[depth-1];
	
protected intpop()

		return stack[--depth];
	
protected voidpush(int n)


	/* Implement a toy stack version of push */
	    
		stack[depth++] = n;