FileDocCategorySizeDatePackage
Stack.javaAPI DocExample577Tue Dec 12 18:58:16 GMT 2000None

Stack

public class Stack extends Object

Fields Summary
private Vector
items
Constructors Summary
public Stack()

	items = new Vector(10);
    
Methods Summary
public booleanisEmpty()

	if (items.size() == 0)
	   return true;
	else
	   return false;
    
public synchronized java.lang.Objectpop()

	int len = items.size();
	Object obj = null;
	if (len == 0)
	    throw new EmptyStackException();
	obj = items.elementAt(len - 1);
	items.removeElementAt(len - 1);
	return obj;
    
public java.lang.Objectpush(java.lang.Object item)

	items.addElement(item);
	return item;