This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Have problem in stack ! not able to get the output Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Have problem in stack ! not able to get the output" Watch "Have problem in stack ! not able to get the output" New topic
Author

Have problem in stack ! not able to get the output

Matt Swaggi
Ranch Hand

Joined: May 29, 2008
Posts: 61

[ June 01, 2008: Message edited by: Campbell Ritchie ]
Matt Swaggi
Ranch Hand

Joined: May 29, 2008
Posts: 61
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

Joined: Oct 27, 2005
Posts: 19654
    
  18

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38033
    
  22
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!!
 
Consider Paul's rocket mass heater.
 
subject: Have problem in stack ! not able to get the output
 
Similar Threads
Stacks Need Help
Name Of file !!!
dealing with compiler warnings
Could not find or load main class StDemo
cannot resolve symbol