RosettaCodeData/Task/Singly-linked-list-Element-definition/Fantom/singly-linked-list-element-definition.fantom

12 lines
251 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
class Node
{
const Int value // keep value fixed
Node? successor // allow successor to change, also, can be 'null', for end of list
new make (Int value, Node? successor := null)
{
this.value = value
this.successor = successor
}
}