Consider a partial version of Bloch’s mutable Stack class: p…
Consider a partial version of Bloch’s mutable Stack class: public class Stack { private Object; } public void push (Object e) { ensureCapacity(); // implementation omitted from quiz elements = e; } public Object pop () { if (size == 0) throw new IllegalStateException(“Stack.pop”); Object result = elements; elements = null; return result; } } Also consider the following client interaction with Stack Stack s = new Stack(); s.push(“apple”); s.push(“orange”); System.out.println(s.pop()); What methods would be needed to convert the client interataction into an equivalent interaction with an immutable version called IStack? For each method, give just the method header – not the contract or implemetation. Choose the most correct answer.