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