import java.util.LinkedList; /** * java栈数据结构的LinkedList实现 */ public class LinkedListAsStack { LinkedList stack = new LinkedList(); public void push(Object o1) { stack.add(o1); } public Object pop() { return stack.removeLast(); } public Object topEle() { return stack.getLast(); } public boolean isEmpty() { return stack.isEmpty(); } public void clean() { stack.clear(); } }