Can anybody explain what is the java concept/ theory if a variable is defined with the class name as it's Data Type?
There is no such concept or theory.
From the Java language perspective, a variable name can be anything as long as it conforms to the required syntax.
From a Java style perspective, a variable name should convey meaning to the reader. But it is up to the author of the code to decide how to convey the meaning and what / how much meaning needs to be (explicitly) conveyed.
In this case, the author has decided that they will simply use node as the variable name. That conveys no meaning in addition to the obvious: it is a "node". The actual intended meaning for this variable is conveyed by the comment:
//reference to the next node
but you could probably figure that out by reading the rest of the code in the Node class and/or the code that uses the class.
For what it us worth, I would probably called the variable next rather than node. But I probably would not have called out the author's choice as incorrect in a code review.
As a general statement, there are differing opinions on what and how much meaning variable names should convey. But there are no generally accepted rules. So you need to be prepared read the code rather than relying on the variable names.
This can be a problem if the code is complicated, or if you are trying to a learn about a new (to you) kind of data structure. But in the latter case, the solution may be to find a better code to learn from.
For instance, any good textbook on Data Structures will have example code for linked lists. The code should be better written and should have accompanying text to explain it. And if you don't want to buy / borrow a textbook, you can probably find better example code on the internet to learn from.
String s = "a value";- that is an instance ofStringnameds. Here you have an instance ofNodenamednode. What part do you not understand?