I am trying to implement a linked list in java. From my knowledge of C++ linked list were implemented by creating a node class:::
struct Node
{
int data;
struct Node *next;
}
And similiar to this I've found that in java node is created by:::
class Node {
int data;
Node next;
}
My doubt is that in the java class there is no address pointing to the next node. In fact what I am able to interpret is that every node recursively will have another node inside it and not its location which theoretically should be the case. I tried finding some help on java forums and they say that the "next" node is actually acting like the c++ pointer but syntax-wise I don't see why would it give the address and not the node itself.