Results 1 to 2 of 2
Thread: Help trying to work with stack?
- 07-23-2012, 04:06 PM #1
Member
- Join Date
- Dec 2011
- Posts
- 14
- Rep Power
- 0
Help trying to work with stack?
Hey there!
I am trying to use a stack. I want to push an object nussinovZelle on it.
A nussinovZelle has several attributes, such as int row and int column.
I print out the nussinovZelle and it works fine, no null pointer exception.
I put it on the stack (stack.push(nz);) and get it again into another nussinovZelle
mz = (nussinovZelle) stack.pop();
now that still works out. if I try to get the rows mz.getRow() or the columns mz.getColumn()
I'm getting a null pointer exception.
I do not know why. the Stack was declared as: Stack<nussinovZelle> stack = new Stack<nussinovZelle>();
can someone help out please? I really need this to work!!
- 07-23-2012, 04:28 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,405
- Blog Entries
- 7
- Rep Power
- 17
Similar Threads
-
Stack help. Why will my peekAtTop() not work??
By MoozicFarm in forum New To JavaReplies: 4Last Post: 03-27-2012, 10:43 PM -
Stack problem. Object array pushed into stack came out different.
By LoViNgHeArTy in forum New To JavaReplies: 2Last Post: 01-14-2012, 08:56 PM -
applet call dll work in Win2000 but not work in WinXP
By manhcuongtin4 in forum Java AppletsReplies: 1Last Post: 07-14-2011, 01:45 PM -
Stack Overflow work around?
By Coukapecker in forum New To JavaReplies: 2Last Post: 03-14-2010, 08:49 PM -
How to set a stack size. -Xss doesn't work
By protonus in forum New To JavaReplies: 4Last Post: 06-27-2008, 06:59 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks