public class MainClass{ static Integer[] storage = new Integer[]{new Integer(1),new Integer(1)}; static int index = 2; public static void main(){ pop(); } public static Object pop() { Object returnValue = storage[index]; storage[index--] = null; return returnValue; } }