/** *Pushesanitemontothetopofthisstack.Thishasexactly *thesameeffectas: *<blockquote><pre> *addElement(item)</pre></blockquote> * *@paramitemtheitemtobepushedontothisstack. *@returnthe{@codeitem}argument. *@seejava.util.Vector#addElement
*/ public E push(E item) {
addElement(item);
return item;
}
/** *Removestheobjectatthetopofthisstackandreturnsthat *objectasthevalueofthisfunction. * *@returnTheobjectatthetopofthisstack(thelastitem *ofthe{@codeVector}object). *@throwsEmptyStackExceptionifthisstackisempty.
*/ publicsynchronized E pop() {
E obj; int len = size();
obj = peek();
removeElementAt(len - 1);
return obj;
}
/** *Looksattheobjectatthetopofthisstackwithoutremovingit *fromthestack. * *@returntheobjectatthetopofthisstack(thelastitem *ofthe{@codeVector}object). *@throwsEmptyStackExceptionifthisstackisempty.
*/ publicsynchronized E peek() { int len = size();
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.