Well copeg, i was not talking about java.util.Stack, i know it doesn't implement isFUll(), infact if i ever implement a stack, i always use isFull() method.
Anyways, thanks Copeg and Junky
Type: Posts; User: Mr.777
Well copeg, i was not talking about java.util.Stack, i know it doesn't implement isFUll(), infact if i ever implement a stack, i always use isFull() method.
Anyways, thanks Copeg and Junky
Why stack class can not have a isFull() method? Kindly give me some reasons. As far as i know, if you are playing with a fixed size stack, you must check it somehow, whether stack is full or not, so...
What if OP had not implemented the circular stack?
And what if his stack is, let's say of size 10 and there are already 10 values in it????
Yeah and the problem is, your stack is empty and you want to pop it.
You must implement, isEmpty() and isFull() for stack class.
And call isFull() before pushing data and isEmpty() before poping.
...