Search:

Type: Posts; User: Norm

Search: Search took 0.23 seconds.

  1. [SOLVED] Re: Pass-by-Value scheme, puzzled with passing/assigning a reference to another objec

    tempStart = last;
    tempNext = tempStart;
    That sets the three variables to point to the same object. There is one object addressed by three reference pointers.
  2. [SOLVED] Re: Pass-by-Value scheme, puzzled with passing/assigning a reference to another objec

    That's why you get the stack overflow. next goes to next goes to next forever.
    To keep toString() from going forever, change it to return this:


    return "Node: " + value + " next=" +...
  3. [SOLVED] Re: Pass-by-Value scheme, puzzled with passing/assigning a reference to another objec

    Do you see what that statement is doing?
    Have you taken a piece of paper and drawn the linked list and manually drawn in what that one statement does?

    Did you add the toString method I...
  4. [SOLVED] Re: Pass-by-Value scheme, puzzled with passing/assigning a reference to another objec

    You need to look at what the code is doing. What does the above statement do to the list?
    What are the values of the two variables?

    One good technique I use for debugging linked lists is to add...
  5. [SOLVED] Re: Pass-by-Value scheme, puzzled with passing/assigning a reference to another objec

    Can you post the print out that show what you are talking about? Add printlns as needed to show the problem and add some comments to the print out describing what is wrong and show what the output...
Results 1 to 5 of 5