The moose likes Java in General and the fly likes Stack clearing problem. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Stack clearing problem." Watch "Stack clearing problem." New topic

Stack clearing problem.

Adam Ellsworth

Joined: Sep 25, 2004
Posts: 21
I'm writing a simple palindrome problem but its giving me a hard time. I'm using stack.empty(); to empty the stack but it is only removing the top element of the stack. Anyone know why it would do this?

P.S. My queue.clear(); works fine.

Thanks in advance.
Adam Ellsworth

Joined: Sep 25, 2004
Posts: 21
Nevermind, just tried stack.clear(); and that worked, ugh, lol.
It is sorta covered in the JavaRanch Style Guide.
subject: Stack clearing problem.
Similar Threads
How to find out where an Exception was thrown ?
NullPointerExcpetion Help
Novice Session Question
WA #1.....word association
Java Mail error java.lang.SecurityException: