public class StackSoluce { StackNode head; StackSoluce() { head = null; } /* question 3.a */ public void push(E element) { head = new StackNode(head, element); } /* question 3.b */ public E pop() { if(head == null) return null; else { E res = head.element; head = head.next; return res; } } }