I agree. Let me rephrase. The user of stack should be only aware of stack and the valueType it pushes or pops. It adds no value (in my opinion ) to give back stacknode of popped value.
So, it makes sense to use stacknode internally in stack to keep track of next value but don’t expose stacknode to the user of stack.
Awh ok. Sorry for the late reply. I think I understand what you're talking about. You want just the value correct not the object?. If that's what you want, you need two change two parts.
I agree. Let me rephrase. The user of stack should be only aware of stack and the valueType it pushes or pops. It adds no value (in my opinion ) to give back stacknode of popped value.
So, it makes sense to use stacknode internally in stack to keep track of next value but don’t expose stacknode to the user of stack.
Awh ok. Sorry for the late reply. I think I understand what you're talking about. You want just the value correct not the object?. If that's what you want, you need two change two parts.
Stack Interface
Stack pop implementation