Eduardo Rod wrote:
Piet Souris wrote:Your push method requires an Entry as argument, but you have a double.
And, when you pop, you do not adjust the size variable.
Yes, the method as you defined receives an object of type Entry, and then you are pushing a float instead of an object would this works?:
Campbell Ritchie wrote:Afraid you have fallen into a common pitfall. Your pop() method doesn't delete the top element; that is a potential memory leak. Since you are using a List, you can probably write return myList.remove(...); and get rid of the memory leak.
I would augment the stack class with an isEmpty() method.
Carey Brown wrote:Line 31 is a closing paren, not a brace.