I'm trying to write a recursive method that prints a linked list in reverse but I get a stackoverflow error. The method should terminate when the last element of the array has been reached, and return control to the method that called it, and then that method will print and return to the one that called it and so forth.
public void print(Node node){
if(node.next != null)
print(node.next);
System.out.println(" " + node.value + " ");
}