Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Linked list problem! Java aspect
Linked list problem! Java aspect
In the comment of the first question, because every Node in the linked list is a Node-type, next is defined by node. It is just an attribute in that line, that is, each node will have an attribute like the next node. If next=null, it is a tail node.

In the comment on the second question, yes, you can't get the size, starting from 0 like an array.

In the comment of the third question, a new Node object is constructed with new, and the parameters in parentheses are used by the constructor. The constructor has no return value, but the statement inside the constructor will be executed like next=nextval.

In the comment of the fourth question, that line reported an error, because your LinList 1 is a virtual class, so you can't create an object. So remove the abstract keyword from the public abstract class linlist 1 Implements list.