62,614
社区成员
发帖
与我相关
我的任务
分享
/**
* Pushes an item onto the top of this stack. This has exactly
* the same effect as:
* <blockquote><pre>
* addElement(item)</pre></blockquote>
*
* @param item the item to be pushed onto this stack.
* @return the <code>item</code> argument.
* @see java.util.Vector#addElement
*/
public E push(E item) {
addElement(item);
return item;
}
Stack s = new Stack();
String str = "a";
String str2 = s.push(str);
System.out.println(str2);
public void push(E item) {
addElement(item);
}