Code example for Stack

Methods: pop, size

0
		return (myPeekStack.size() > 0 || myEnumeration.hasMoreElements());
	} 
	 
	public Object nextElement() {
		Object element;
		if (myPeekStack.size() > 0) {
			element = myPeekStack.pop();
		} 
		else { 
			element = myEnumeration.nextElement();
		} 
		return element;
	} 
	 
	public Object peek() {
		Object peekValue;
		if (myPeekStack.size() == 0) {
			if (hasMoreElements()) { 
				peekValue = nextElement();
				myPeekStack.push(peekValue);
			}