Now to start debugging the code. I added a toString() method to the ListNode class so it can be printed easily. Print out the value and the next. A side effect is it will print the whole list thru...
Type: Posts; User: Norm
Now to start debugging the code. I added a toString() method to the ListNode class so it can be printed easily. Print out the value and the next. A side effect is it will print the whole list thru...
It's missing the ListNode class definition.
How would I compile and test the program?
You should not need a try/catch block for an event that the program should never let happen.
Can you post code that compiles, executes and shows the problem?