can you spot the memory leak

public class Stack{
private Object[] objects;
private int size = 0;
private static final int DEFAULT_INITIAL_CAPACITY = 16;

public Stack() {
objects = new Object[DEFAULT_INITIAL_CAPACITY];
}

public void push(Object e) {
objects[size++] = e;
}

public Object pop() {
if (size == 0) {
throw new EmptyStackException();
}
return objects[--size];
}
}



---请留言。。
posted @ 2015-11-18 17:59  一行白龙上青天  阅读(256)  评论(0编辑  收藏  举报