need help in Java passing objects
<p>UPDATE:
i modified the hashCode, now is a little better. :) but the problem is still there... :(</p>

<p>so, and modified my method too:</p>

<pre><code>private Node getMinNode()
{

    int min = 9999999;   //value
    Node minNode = new Node(); //key,index

    for (Node key : this.distances.keySet()) {

        int minOfNode= this.distances.get(key);

        System.out.println("Key "+ key +", Value = " + minOfNode);

        if(minOfNode&lt;min)
        {
           min= minOfNode;
           minNode= key;
           System.out.println("Key minNode = " + minNode + ", Value minNode = " + minOfNode);

        }
    }

    return minNode;

} 
</code></pre>

<p>and there is the output: (the whitespace(, ,) in the lines would be an empty char) and this is not the end... this is only the first few row...</p>

<pre><code>   Key 66601, 3546492, 3546493, 228, f, Value = 9999999
   Key 77393, 3628185, 3628186, 64, t, Value = 9999999
   Key 0, 0, 0, 0, , Value = 0 
   Key minNode = 0, 0, 0, 0, , Value minNode = 0
   Key 66601, 3546492, 3546493, 228, f, Value = 9999999 
   Key 77393, 3628185, 3628186, 64, t, Value = 9999999 
</code></pre>

<p>(note: the element with 'Key 0, 0, 0, 0, , Value = 0' does exists, this is the startNode)
in that constructor the attribs are initialized with the zeros, i know,
so my main problem is, why is that happening? they are passed rigth out of the if(), but in the if() they arent
i hope it's clearer what is my problem. :)</p>
