import java.util.LinkedList;
.....
Couldn't be simpler to use a linked list in Java, one is provided as standard for your enjoyment
newNode.next = tailNode;
tailNode = newNode;
length++;
All I get is an infinite loop where it adds the first character, an "A".
Obviously I am not incrementing the pointer to the Node's .next property
Kinda weird as there are no pointers for your manipulation in Java.
I do notice you are creating a circular reference here, probably not what you intended.
Reputation Points: 1658
Solved Threads: 331
duckman
Offline 7,719 posts
since Nov 2004