I have created a Node class which takes the a value (int) in the constructor. It also can store another Node as 'next'. I have found out that when I create a Node like this:
public void methodSignature(int value) {Node node = new Node(value);}
in a method, and then on another call of the method creates the exact same object if the input is the same. Why is this? What can I do to avoid it? It's cauing issues with my program.