Microsoft interview question

Implement a class Stack

Interview Answer

Anonymous

Oct 19, 2016

Make an arrayList as a private variable with two methods. Push and Pop. Push would just add the element, pop would return and remove the most recent element using arr.get(arr.size()-1); and arr,remove(arr.size()-1).

2