FileDocCategorySizeDatePackage
ToyStack.javaAPI DocExample526Fri Oct 15 17:46:02 BST 1999None

ToyStack

public class ToyStack extends Object
Toy Stack.

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];
	
protected intpop()

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


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