用java代码自己完成一个队列和栈?求指教啊
------解决方案--------------------
- HTML code
"Java"public class StringStack(){private LinkedList<String> linklist;public StringStack(){linlist=new LinkList<String>();}public void push(String name){linklist.addFirst();}public String top(){return linklist.getFirst();}public String pop(){return lijnklist.removeFirst();}public boolean isEmpty(){return linklist.isEmpty();}}