This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Have problem in stack ! not able to get the output

 
Matt Swaggi
Ranch Hand
Posts: 61
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

[ June 01, 2008: Message edited by: Campbell Ritchie ]
 
Matt Swaggi
Ranch Hand
Posts: 61
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry guyz i have done mistake and i made it finaly !
realy sorry for posting ! the mistake is i havent passed the "item"
 
Rob Spoor
Sheriff
Pie
Posts: 20372
44
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Two notes:
1) you may want to check against stack.length - 1 instead of 9. That will cause less bugs should you wish to change the size of the array.
2) printing an error and returning 0 may not be a good option for real-life projects. Instead, throw a RuntimeException.
 
Campbell Ritchie
Sheriff
Pie
Posts: 47244
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please use code tags when posting code; it makes it easier to read. I have edited your post; see how much better it looks.
And please write your question in the text of the post, otherwise people won't realise what the question is!!
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic