7 pushed into stack2.
8 pushed into stack2
Exception in thread "main" java.lang.NullPointerException
at Stack.pop(sortStack.java:33)
at sortStack.main(sortStack.java:110)
sonu jha wrote:yeah..sure..
the new pop is below:
See the lines 7 and 15...i am updating the reference last after a pop operation...that's what was missing before...except for that it is all the same....
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
sonu jha wrote:The main prompts user input to fill up stack1, and should then proceed to fill up stack2 which would be sorted in ascending order. The following is the code:...
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
If you settle for what they are giving you, you deserve what you get. Fight for this tiny ad!
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|