java.lang.Objectcz.muni.fi.pb162.stackexample.NumberStack
public class NumberStack
This is a simple, example implementation of a stack that can store only integers. It supports only basic operations.
Constructor Summary | |
---|---|
NumberStack()
Constructor for objects of class NumberStack Inicializes stack |
Method Summary | |
---|---|
boolean |
isEmpty()
|
java.lang.Integer |
pop()
Deletes the top-most value from the stack. |
void |
push(int numberToStore)
Stores given integer value on the top of the stack |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NumberStack()
Method Detail |
---|
public boolean isEmpty()
public java.lang.Integer pop()
null
if the stack is emptypublic void push(int numberToStore)
numberToStore
- integer value to store in the stack