public class Node {
private Node nextNode;
@Override
public int hashCode() {
//How to implement this?
//Because you just have a attribute which is a reference.
//I think the attribute is almost useless, because if you use the HashCode of the attribute, you will finally fall into a useless loop.
//Thus, I think you should find a way to represent the HashCode of reference (instance) itself.
}
}
From the comment in the code, my question is actually how to uniquely identify reference itself, like address in C.