Thread: More Java Help
View Single Post
Old 03-14-2005, 06:38 PM   #3
Callum
Symbol of Cyric
 

Join Date: October 21, 2004
Location: Vancouver, BC
Age: 36
Posts: 1,143
Well, I suppose I wasn't exactly expecting the code [img]tongue.gif[/img] .

WHat you have suggested, I think I've already tried.

Here's what I have.

The ListNode class creates objects with a String variable and another ListNode object within them. The first one is called head, and so this is the only one that I actually know the name of.


To traverse the list, I created a new ListNode called positio, and set it equal to head. I then have a while loop to set position to position.getNextNode until I find what I am looking for. It is here that I encounter the problem.

If I simply do the following:

position = new ListNode(addData, position);

Then position will not be a part of the list itself, and the main list will be unchanged. Will it not?

Edit: Just noticed the word thanks doesn't appear in my post Thanks, and thanks in advance.

[ 03-14-2005, 06:41 PM: Message edited by: Callum ]
__________________
[img]\"http://img11.imageshack.us/img11/4763/callumavataranimated4ff.gif\" alt=\" - \" />
Callum is offline   Reply With Quote