I would add ID Strings to make it clearer:
return "Node: " +value + " next=" + next;
The this & toString() are redundant
Type: Posts; User: Norm
I would add ID Strings to make it clearer:
return "Node: " +value + " next=" + next;
The this & toString() are redundant
Did you try adding a Public String toString() {} method to the Node class that returns a String with the value and next values. It allows you to print a node easily for debugging. For example if...
Does it compile and execute?
For debugging I'd add a toString() method to the Node class that would return the value and next variables. Then you can print a Node and see it all.
Test with code to create an instance of the Node class, compile and execute it.
To visualize a linked list, take a piece of paper, draw some Nodes with data and next and chain the Nodes together. ...
The Node class has a value and a pointer to the next Node.
Have you tried creating an instance of the Node class? You should be compiling and testing the code after each small step to check if...