View Single Post
Join Date: Sep 2008
Posts: 91
Reputation: ezkonekgal is an unknown quantity at this point 
Solved Threads: 1
ezkonekgal ezkonekgal is offline Offline
Junior Poster in Training

Re: i need help on stack. If pop: stack is empty.

 
0
  #5
Jan 12th, 2009
Originally Posted by BestJewSinceJC View Post
Can you post the error you are getting? It should include the line number, method names, and error name... info that would be incredibly helpful in helping you.

when you put an item in the shelf, is done by push method, and then try to retreive the item, done by pop, i doesn't have error, only just print's stack empty.. because i did specify in the code that if empty print to console Satck is empty. the program continues to run.

ok w8, i got this recenlty

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 3
at MStack.push(MStack.java:45)
at BookShelf.options(BookShelf.java:48)
at BookShelf.<init>(BookShelf.java:24)
at BookShelf.main(BookShelf.java:19)
Last edited by ezkonekgal; Jan 13th, 2009 at 12:02 am.
Reply With Quote