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!!
Re: Help trying to work with stack?
Can you show us the relevant code?
kind regards,
Jos