Class FixedStack

java.lang.Object
  |
  +--FixedStack
All Implemented Interfaces:
IntStack

public class FixedStack
extends java.lang.Object
implements IntStack


Constructor Summary
FixedStack(int size)
          Constructor.
 
Method Summary
 int pop()
          Print msg if stack is empty (underflow)
 void push(int item)
          Print msg if stack is full (overflow)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FixedStack

public FixedStack(int size)
Constructor.

Parameters:
size - maximum size of the stack. DO NOT EXCEED.
Method Detail

push

public void push(int item)
Print msg if stack is full (overflow)

Specified by:
push in interface IntStack
Parameters:
item - the thing to be pushed

pop

public int pop()
Print msg if stack is empty (underflow)

Specified by:
pop in interface IntStack
Returns:
the topmost items