Public? Class? Node? {
Public? int? Value;
Public? Node? Next;
Public? Node(int? Value)? {
this.value? =? Value;
This, next? =? null
}
Public? Invalid? Add (node? Node)? {
This, next? =? Node;
}
Public? Bull? hasNext()? {
Return? This, next? ==? null? Fake? :? True;
}
Public? Static electricity Invalid? main(String[]? args)? {
Node? First of all? =? null? //Record the first node for later traversal.
Node? Node? =? null? //Save the current input node for use.
Scanner? Are you online? =? New? Scanner (system. in); ? //Used for console input, and ctrl+Z ends the input.
while(in.hasNext())? {
int? v? =? in . nextint();
Node? n? =? New? Node (v);
If (first? ==? null)? {
First of all? =? n;
Node? =? n;
}? Or what? {
node . add(n);
Node? =? n;
}
}
If (first? ==? null)? {
System.out.println ("no digital input");
}? Or what? {
Node? =? First;
System.out.println(node.value? +? "");
while(node.hasNext())? {
Node? =? node.next
System.out.println(node.value? +? "?" );
}
}
}
} simulate the simplest single linked list, improvise by hand, for reference only, hope to adopt.