package stack; import list.LinkedList; import list.ListInterface; public class ListStack implements StackInterface { private ListInterface list; public ListStack() { list = new LinkedList(); } public void push(E newItem) { list.add(0, newItem);; } public E pop() { return list.remove(0); } public E top() { return list.get(0); } public boolean isEmpty() { return list.isEmpty(); } public void popAll() { list.clear(); } //////////////////////////////// public void printAll() { list.printAll(); } } // 코드 6-7